javascript - jQuery click handler does not fire on first click in Safari -


i'm having following issue exclusively in safari: i'm attaching click handler input.

if attach handler such, callback doesn't called until second click:

this.$applyform.find("input[type='email']").click( (originalevent) => {   originalevent.preventdefault();   console.log('this should fire'); }); 

however, if attach such, callback gets called expected:

this.$applyform.on('click', "input[type='email']", (originalevent) => {   originalevent.preventdefault();   console.log('this fire') } 

it doesn't seem issue of html not being included, 2 reasons:

1) if log this.$applyform.find("input[type='email']") before click handler attached, logs element and if element wasn't present when handler got attached, never fire handler wouldn't attached.

2) it's safari-only issue.

any insight appreciated.


Comments