Skip to content
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

input[type="range"] "change" event firing differs from native implementations #297

Closed
hparra opened this issue Oct 24, 2013 · 3 comments
Closed

Comments

@hparra
Copy link

hparra commented Oct 24, 2013

On recent versions of Webkit and Firefox the change event fires after every step of input[type="range"]. The webshim polyfill change seems to fire on keyup/mouseup.

My original "change" method for input[type="range"] was binded to keyup/mouseup for performance reasons.

From what I've seen in range-ui.js, I assume my listeners stay on the original element and the change event is triggered when the polyfill changes the original's value on each step. Is this correct?

@aFarkas
Copy link
Owner

aFarkas commented Oct 24, 2013

Yes, you should bind to the original element.

The change event is triggered if a a) value was changed by the user and b) commit action (mouseup or keyup in case of a range input) or a activation/blur behavior happened. The behavior in FF is correct, while the behavior in Chrome is busted. Actually Chrome-Dev doesn't want to change this.

Is this just a question or do you think there is something wrong with webshims implementation. Please re-open, if there is a bug.

@aFarkas aFarkas closed this as completed Oct 24, 2013
@hparra
Copy link
Author

hparra commented Oct 26, 2013

I understand now: webshims implements change and input events correctly, as does FF. Webkit and IE10 trigger change incorrectly, with IE10 not having input at all. Do you know of any low-level (global) jquery fix for this?

Thanks for the library.

@aFarkas
Copy link
Owner

aFarkas commented Oct 27, 2013

The input event is already fixed by webshims in IE10/11. I have just added some code to fix the change event in IE10/11, chrome and Safari. The fix is currently turned off by default. You can turn it on by setting the fixRangeChange to true:

webshims.setOptions('forms', {fixRangeChange: true});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants