Make a Callback for After a Dropdown Menu Has Opened
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
Research direction
Start with the Dropdown behavior described in the issue and the linked custom dropdown components example, then trace how onToggle and focusFirstItemOnShow handle opening and focus. Done means providing a post-open callback or equivalent behavior so inputs inside the menu can receive focus and be reached by keyboard after opening.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe
Yes, I have implemented custom dropdowns that contain various inputs, like selects, text inputs, checkboxes and radio buttons. I used the example outlined here that includes a text input: https://react-bootstrap.github.io/components/dropdowns/#custom-dropdown-components
However, as you can see even in the example linked above, after the first open of the dropdown users cannot tab into the input. This is a huge issue for accessibility. I was trying to use the onToggle callback for the Dropdown to put focus on the first input however this callback triggers just before the menu opens in the UI.
Describe the solution you'd like
A method that triggers after the UI has updated, or possibly for the Dropdown to put focus automatically on the first input element when opened
Describe alternatives you've considered
I ended up creating a Custom.Item anchor tag that is empty and has 'tabindex=-1'. then, when that element gains focus due to the dropdown having 'focusFirstItemOnShow={true}' i can manually put focus into the first input. However, it seems like there should be a better way.
Additional context
n/a
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 3.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react-bootstrap/react-bootstrap
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
react-bootstrap/react-bootstrap#6989 ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
react-bootstrap/react-bootstrap#6987 · 2 comments · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
react-bootstrap/react-bootstrap#6985 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
react-bootstrap/react-bootstrap#6984 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
react-bootstrap/react-bootstrap#6962 · 1 comment ·
All issues in react-bootstrap/react-bootstrap
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·