Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-change event is not triggered for IE11 when the element has no keydown event fired #14783

Open
@lowndesa

Description

@lowndesa

Do you want to request a feature or report a bug?
bug

What is the current behavior?
ng-change is not triggered when an input is focused on the keydown event of another element

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
See: http://plnkr.co/edit/wMuouRnMbGWoEAZpnzLX?p=preview
Ensure the focus is on the document, press tab to focus the non-input and then press a key.

What is the expected behavior?
The input is focused, the entered key is inputted and the underlying model is updated, calling the change event bound to the input

What is the motivation / use case for changing the behavior?
Need to ensure that there is consistency across browsers

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular?
IE11 is affected by this bug, Chrome is ok. Tested in angular 1.5.6 and latest snapshot

Other information
see line '$sniffer.hasEvent('input')' in angular.js where the alternative is provided. The keydown event is not triggered on the new input so the polyfill does not serve the purpose in this case.

Activity

added this to the Ice Box milestone on Jun 15, 2016
gkalpak

gkalpak commented on Jun 15, 2016

@gkalpak
Member

Unfortunately, the input event is pretty much broken on most IEs, so we can't rely on it.
We are doing our best to keep the behavior consistent across browsers.

That said, support of such an uncommon usecase (chaging focus in the middle of the event dispatch flow, so that some events are triggered on an element, but others not) is outside the scope of core imo.
You can still support such usecases, by manually firing the necessary events.

wesleycho

wesleycho commented on Jun 16, 2016

@wesleycho
Contributor

If I manage to fix up my PR so that the input event can be used in 10 & 11, would this fix the issues for those browsers?

gkalpak

gkalpak commented on Jun 16, 2016

@gkalpak
Member

@wesleycho: What PR? How is it related to this?
(In any case, from what I understand the input event on IEs is beyond repair 😃)

wesleycho

wesleycho commented on Jun 16, 2016

@wesleycho
Contributor
gkalpak

gkalpak commented on Jun 16, 2016

@gkalpak
Member

So, if we were able to use the input event for all browsers, things would be better (at least more consistent). But like I said, not very likely...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wesleycho@gkalpak@lowndesa

        Issue actions

          ng-change event is not triggered for IE11 when the element has no keydown event fired · Issue #14783 · angular/angular.js