adobe / adobe/spectrum-web-components

[Bug]: Fixed width buttons break focus styling

Open
#5,421 2 comments 0 reactions 0 assignees View on GitHub
bug Component:Button SEV missing
Dominant language
TypeScript
Stars
1.5k
Forks
262
Avg merge
3d 10h
Merged PRs (30d)
68

Description

### Code of conduct

- [x] I agree to follow this project's code of conduct.

### Impacted component(s)

sp-button

### Expected behavior

Should be able to create a fixed width button with a long label which truncates without breaking the keyboard focus ring.

### Actual behavior

Creating a fixed width button with overflow:hidden breaks the focus ring.

### Screenshots

_No response_

### What browsers are you seeing the problem in?

Chrome, Firefox, Safari, Microsoft Edge

### How can we reproduce this issue?

1. Go to https://studio.webcomponents.dev/edit/8zDzFboByFRPg81avRUF/src/index.ts?p=stories
2. keyboard focus on the first button with overflow:hidden;
4. Note there is no focus ring
5. tab to the 2nd button without overflow:hidden
6. Note there is a focus ring

### Sample code or abstract reproduction which illustrates the problem

_No response_

### Severity

None

### Logs taken while reproducing problem

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the sp-button component and reproduce the behavior using the linked studio example at src/index.ts. Compare keyboard focus on the fixed-width button with overflow:hidden against the second button, then verify that a long label truncates while the focus ring remains visible in Chrome, Firefox, Safari, and Edge.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.