-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Don't use jQuery events as proxies for DOM Events. #3108
Comments
Reviewing the React code further, in the case of checkbox.js:507 react requires a |
Yeah, I always assumed trigger was using native events. Very surprised that they are not. Marked as a bug |
Added in |
This change caused Backbone Views not to trigger events (Backbone uses jQuery under the hood to listen for events). Before I was able to declare the change event on selects converted to dropdowns with SemanticUI, now the events are not intercepted. Does anybody have a clue why this is happening to me, or how to circumvent this problem? See fiddle with 2.1.5 and change events not being intercepted by Backbone http://jsfiddle.net/trigoesrodrigo/yko902w0/ |
I've just looked into this, the issue is that the changes have created the events with the wrong bubble/cancel flags. They should be reversed. Standard events should be bubbling and non-cancelable, but the changes added here have created non-bubbling cancelable events instead. @jlukic You need to swap the booleans on your See initEvent and change event documentation. Bubbling is required for a lot of other libraries because they install a central event handler which needs to catch and filter the events once they hit the top level. |
This was patched, in |
should be used in place of
since the former is available to all listeners whereas the latter is only available to jQuery or to listeners attached directly to
$node
(i.e. it bubbles in jQuery but not in DOM).In the case of the
blur
event thenode.blur()
function can be used instead.The relevant sections of code are:
checkbox.js:507
dropdown.js:2187
search.js:213
What led me to this was trying to get
<select>
dropdowns to work with React. Without this modification thesettings.onChange
function must be set to update the React state. With this modification the following examples all function the same way:This makes the integration with React automatic in these cases.
The text was updated successfully, but these errors were encountered: