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

Double focus and double blur #382

Closed
ellenaua opened this issue Apr 16, 2016 · 1 comment
Closed

Double focus and double blur #382

ellenaua opened this issue Apr 16, 2016 · 1 comment

Comments

@ellenaua
Copy link

ellenaua commented Apr 16, 2016

We have multiple paper-inputs on page, and each of them has on-focus and on-blur handler assigned. If I navigate inputs using mouse clicks - everything is OK, on-focus event happens once I click some input, and on-blur happens when I leave it.

"input1 focused"
"input1 blurred"
"input2 focused"
"input2 blurred"
"input3 focused"
"input3 blurred"

But if I havigate using Tab key, then during "focus" input emits these three(!) events:

"input3 focused"
"input3 blurred"
"input3 focused"

and when I leave that input, it emits "blur" as expected:
"input3 blurred"

It seems to be non-important bug.. but: we need to focus input1 when blur happens on input3. But blur on input3 happends too early: when I'm just going to focus it. I think "blur" event should not be emitted when user navigates to an input. Bug happens only if I navigate using Tab key. Browser: Chromium Version 48.0.2564.82 Ubuntu 14.04 (64-bit)

Here's the jsbin https://jsbin.com/vecagi/edit?html,console,output

@notwaldorf
Copy link
Contributor

notwaldorf commented May 31, 2016

Argh, yeah, I think this is happening because when you tab to the paper-input, we have to focus the inner <input>, which will also cause a blur on the parent paper-input. I don't think this can be avoided at the moment. :(

I'm tempted to close this, as I don't think we can fix this -- it's a current problem with focus and the shadow/shady dom, that could be fixed in the future when delegatesFocus is implemented

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