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

Focus event ordering is incorrect. #131

Open
rwjblue opened this issue Dec 6, 2017 · 1 comment
Open

Focus event ordering is incorrect. #131

rwjblue opened this issue Dec 6, 2017 · 1 comment

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented Dec 6, 2017

Demo: https://output.jsbin.com/vilumo

    let element = document.createElement('input');

    ['mousedown', 'mouseup', 'click', 'focus', 'focusin'].forEach(type => {
      element.addEventListener(type, () => {
        console.log('event:', type);
      });
    });

    document.body.appendChild(element);

Tested on MS Edge, FireFox, Chrome, and Safari the output is:

event: mousedown
event: focus
event: focusin
event: mouseup
event: click

However, our utility function fires them as mousedown, focusin, focus, mouseup, click. I noticed this while migrating the implementation to @ember/test-helpers and writing unit tests for the behavior of click.

@rwjblue
Copy link
Collaborator Author

rwjblue commented Dec 6, 2017

TBH, I believe this discrepancy has always existed. I only created an issue because I'd like for this library to match the behavior as much as possible with @ember/test-helpers.

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

1 participant