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

Button has odd focus behavior when adding padding #3790

Closed
nicholasrice opened this issue Aug 26, 2020 · 3 comments
Closed

Button has odd focus behavior when adding padding #3790

nicholasrice opened this issue Aug 26, 2020 · 3 comments
Labels
bug A bug closed:not-actionable There is no action to be taken in response to this issue. community:request Issues specifically reported by a member of the community.

Comments

@nicholasrice
Copy link
Contributor

nicholasrice commented Aug 26, 2020

Describe the bug; what happened?

The above SS has padding applied to the fast-button host. This causes the focus rect to draw inside the box of the host because focus is actually on an internal button element. We should move the focus rect to the host element and use :focus-within to account for this.

@nicholasrice nicholasrice added status:triage New Issue - needs triage area:fast-components bug A bug and removed status:triage New Issue - needs triage labels Aug 26, 2020
@chrisdholt
Copy link
Member

Let’s remember to include “fast-anchor” as part of this as the styles are shared.

@CuddleBunny
Copy link
Contributor

@chrisdholt - The affected styles are shared so the fix will apply to both.

@EisenbergEffect EisenbergEffect added this to the Release 08 milestone Aug 26, 2020
@EisenbergEffect EisenbergEffect added the community:request Issues specifically reported by a member of the community. label Aug 26, 2020
@EisenbergEffect EisenbergEffect added the status:in-progress Work is in progress label Aug 26, 2020
@nicholasrice
Copy link
Contributor Author

As discussed in #3792, the problem with my proposed approach is that :focus-within does not follow the same selection rules as :focus-visible.

Instead, the developer should set padding on the internal button element using CSS parts:

fast-button::part(control) {
  padding: 12px
}

We can re-visit this if we ever get a :focus-visible-within selector

@nicholasrice nicholasrice added closed:not-actionable There is no action to be taken in response to this issue. and removed status:in-progress Work is in progress labels Sep 8, 2020
@EisenbergEffect EisenbergEffect removed this from the Release 10 milestone Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug closed:not-actionable There is no action to be taken in response to this issue. community:request Issues specifically reported by a member of the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants