-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InputEvents not binding correctly #26
Comments
Noticed this works if we change: https://github.com/akre54/Backbone.NativeView/blob/master/backbone.nativeview.js#L125 to enable
Any objections to a PR for this? |
This would be a breaking change. Do you see any downsides? |
We could also specifically enable |
I haven't noticed any but haven't done any perf tests. Maybe performance would be effected slightly? Not sure if it would be breaking. The API would still work as it is to the user, would just fix this bug |
What about other input specific events? Blur and input seem to be effected also |
The problem with Is it obvious how jQuery does it? |
Hmm let me investigate that and I'll post back :) Thanks btw, I'm build a Marionette.Native plugin. This library and On Friday, August 26, 2016, Adam Krebs [email protected] wrote:
|
So looking at the jquery source, they seem to attach the events to each element individually rather than the document: https://github.com/jquery/jquery/blob/76c5237cc408c01ae67f5c68d39ed6f1e4ef8003/src/event.js#L92-L94 This would probably be quite a large piece of work for this library as we'd need to manage unbinding as well. What do you think @akre54 ? |
Right. (sorry I was thinking of jQuery's * Also the 4-arg form of |
I'm split on this. I think our two options are to whitelist events that don't bubble ( _.first(this.$('input')).addEventListener('change', () => {}) Both have their downsides, but also aren't horrific in the grand scheme of things. |
Yeah I agree, the I'd be happy with a whitelist - I'm yet to see adverse effects using |
Sure thing. Wanna open a pull with an implementation? |
Yeah sure, ill get on it tomorrow morning (UK based 😄) |
Seen this? |
Hi,
I have the following events hash:
someHandler
is never called> I think this may be becauseNativeView
is relying on the Event propagating up the tree and checking whether selectors match on the eventTarget. Is the issue that InputEvents such asblur
,input
orchange
don't get propagated up to non-input nodes?Would a better way to attach events be to query the view for the selector and use
addEventListener
on the Elements that returns rather than theView
s root element?The text was updated successfully, but these errors were encountered: