-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Hitting enter key on Internet Explorer text boxes with multiple buttons #4464
Comments
Can confirm that this difference in behavior exists. Whether it should be classified as a bug is an entirely different story and a matter of opinion. 😄 What is happening becomes quite clear with this JS Bin: Default browser form behavior is that pressing "enter" inside an In my example I've wrapped each section with a Generally I would not rely on IE's behavior, nor would I try to override the "enter" handling on an input text as that seems brittle. Nevertheless, we have a difference in functionality here, which we should probably deal with. Interestingly, this might be considered a jQuery bug as opposed to an Ember bug (without doing any tracing of it at all). @wagenet Optional close, but should probably get a few seconds of thought at a core team meeting if we're not going to address it/punt it to somebody else. |
I faced this issue and I used this workaround: |
I often wrap fields with forms and use action on the form. It's a nice setup even without the IE issue. |
I also like wrapping fields with form tags. This might be something to look at if you want to have some structure around that: https://github.com/dockyard/ember-easyForm |
Not sure how much more there is to do here. |
Adding I tested the following bin in IE10 and it worked as expected: |
@meirish — nice one! |
If you have a form with multiple buttons and using Internet Explorer (tested with IE 10), the
action
attribute onEmber.TextField
will not work for any action other than the first button.Here's a JSFiddle: http://jsfiddle.net/davidmcch/Nm9a6/2/
To re-create:
In Chrome, the message is the expected "Action #2 (Two)". In Internet Explorer, the message is "Action #1 (one)". This occurs in Internet Explorer 10 and IE9 compatibility mode. (IE8 and lower doesn't work at all with the JSFiddle example.)
I looked into
Ember.TextSupport
, and I think it's an issue not suppressing the default "key-press" event behavior.In Chrome, the events (as fired within the
sendAction
function) are:focus-in
eventkey-press
and then immediately theenter
eventIn IE, the
enter
event is never fired.I'm not sure if this is something that should be handled within Ember or whether we need to handle it elsewhere (customized View class?).
The text was updated successfully, but these errors were encountered: