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

paper button receives 'keyboard-focus' when refocusing tab #24

Open
anthonytordillos opened this issue May 29, 2015 · 14 comments
Open

paper button receives 'keyboard-focus' when refocusing tab #24

anthonytordillos opened this issue May 29, 2015 · 14 comments

Comments

@anthonytordillos
Copy link

If you click a paper-button, then unfocus and refocus the tab, paper-button receives the keyboard-focus class. It also looks like this happens with other elements (e.g. paper-icon-button), and it leads to a somewhat broken looking experience.

@kungufli
Copy link

I can confirm this problem, this happens on the official polymer-project website too.

@m4b
Copy link

m4b commented Jun 18, 2015

confirmed as well; similar things occur with radio-buttons, etc., which seems especially broken.

@notwaldorf
Copy link
Contributor

@cdata Sigh. I think this might also be an instance of the "focus without a mouse down is automatically a keyboard focus" issue, which is technically not super true in the "re-activate tab" case :(

@notwaldorf
Copy link
Contributor

This is related to PolymerElements/paper-radio-button#33.

@tjsavage
Copy link
Contributor

tjsavage commented Aug 4, 2015

This looks like it is still an issue as of merging PolymerElements/iron-behaviors#23

@notwaldorf could you take a look?

@tjsavage tjsavage reopened this Aug 4, 2015
@notwaldorf
Copy link
Contributor

@tjsavage this isn't a new bug, it's been around forever (including 0.5). i think @cdata is our focus expert, unfortunately.

@tjsavage
Copy link
Contributor

Quick bump on this issue

@anthonytordillos
Copy link
Author

Ping?

@rictic
Copy link
Contributor

rictic commented Oct 26, 2015

Gentle ping on this.

@anthonytordillos
Copy link
Author

Any update? Coming up on a year since this was filed.

@keanulee
Copy link
Contributor

The reason why this still hasn't been fixed is because the platform gives us no reliable way of determining whether focus came from a mouse or keyboard (which, in Material Design, look different when focused). Currently, we rely on the state of the pointer (https://github.com/PolymerElements/iron-behaviors/blob/master/iron-button-state.html#L116), but the pointer will not be pressed when switching between tabs, so that is why it has "keyboard-focus". We are actively looking for other ways to fix this, but there doesn't seem to be any alternatives.

@anthonytordillos anthonytordillos changed the title paper button receives 'keyboard-focus' when refocuses tab paper button receives 'keyboard-focus' when refocusing tab Sep 30, 2016
@MichaelScript
Copy link

MichaelScript commented May 22, 2018

Is there a reason we can't just listen for whether or not the tab is active on the window and then blur the focus? I tested this within the ready function of the paper-button element and this fixes the issue however I'm not sure where the right place for this would be or if there might be a better variation of this because I might not be thinking of other situations.

document.addEventListener('visibilitychange',function(){
	console.log("Changed");
	this.blur();
}.bind(this));

@JanMiksovsky JanMiksovsky removed their assignment May 22, 2018
@esurface
Copy link

hitting this bug five years later. any workarounds?

esurface pushed a commit to Tangerine-Community/tangy-form that referenced this issue Sep 16, 2020
@cdata cdata removed their assignment Sep 17, 2020
@cdata
Copy link
Contributor

cdata commented Sep 17, 2020

Hey @esurface it seems unlikely that there will be significant changes to this component moving forward. It is possible that the issue could be taken up by someone in the community to be fixed. I'm happy to look at any PR someone might come up with to attempt a fix.

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

No branches or pull requests