Skip to content

Fixed #6242 #256

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

Merged
merged 1 commit into from
May 13, 2011
Merged

Fixed #6242 #256

merged 1 commit into from
May 13, 2011

Conversation

dcneiner
Copy link
Member

Button: no longer calls _resetButton() after changing the disabled option. Fixed #6242 - Button .enable() strange behavior on Webkit (Google Chrome, Safari)


The call to _resetButton during the mouse events was causing the problem. However, _resetButton does not respond to the enabled or disabled state of the button in any way. However, setting this option was used to trigger reset on create, so I added the explicit call to _resetButton under the _setOption call at the end of the _create method.

All unit tests for button are still passing with these changes.

Demo of both broken and fixed version of the code: http://jsbin.com/ohene4/9

…tion. Fixed #6242 - Button .enable() strange behavior on Webkit (Google Chrome, Safari)
@jzaefferer
Copy link
Member

Could you try and add a test that actually fails without the moidification? THat way we'll have an actual regression test.

@dcneiner
Copy link
Member Author

I just tried to write a unit test, but I don't think it can be done. The change of state has to happen between mousedown and mouseup of the click event for the bug to appear. With the current simulate plugin, simply simulating mousedown then mouseup does not trigger a click -- and simulating a click after those two actions does not reveal the same problem.

@dcneiner
Copy link
Member Author

More info: It breaks because when _resetButton() is called, it replaces the span that the mousedown was originally fired on. Apparently a click cannot start on a child element that is removed during the action in Webkit.

scottgonzalez added a commit that referenced this pull request May 13, 2011
@scottgonzalez scottgonzalez merged commit dd00f7f into jquery:master May 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants