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

Unable to select options from SplitButton with keyboard if children are link buttons #4784

Closed
1 task done
clheppell opened this issue Feb 3, 2022 · 2 comments · Fixed by #6204
Closed
1 task done

Comments

@clheppell
Copy link

Current behaviour

On Sage 200 some of our SplitButtons contain children which are links. For this we make carbon buttons into links following the example given in the usage with routing documentation.

When a user tries to use the keyboard to select an option from the split button, they are unable to. In the console we see Uncaught TypeError: additionalButtons.current[nextIndex].focus is not a function from within the Carbon SplitButton component.

Impacts accessibility and slows down our power users who like to use the keyboard.

Expected behaviour

User should be able to select options from the dropdown with their keyboard as when the split button has only buttons as children.

CodeSandbox or Storybook URL

https://codesandbox.io/s/bold-sunset-ztpoc?file=/src/index.js

JIRA Ticket (Sage Only)

No response

Suggested Solution

No response

Carbon Version

104.0.0

What browsers are you seeing the problem on?

Firefox, Chrome

What Operating System are you seeing the problem on?

Windows

Anything else we should know?

Also applies to the MultiActionButton

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@clheppell clheppell added Bug triage Triage Required labels Feb 3, 2022
@nicktitchmarsh nicktitchmarsh added On Backlog and removed triage Triage Required labels Feb 8, 2022
@nicktitchmarsh
Copy link
Contributor

FE-4920

robinzigmond added a commit that referenced this issue Jul 18, 2023
SplitButton and MultiActionButton used to clone their children and pass particular props, including
refs - assuming each child was a Button component. This meant that the components failed to work
properly when using custom child components that wrap one or more Carbon Buttons (at least unless
forwardRef was used). This has now been replaced by a context-based approach using DOM selectors to
achieve the same functionality no matter how the children are composed.

fix #4784
robinzigmond added a commit that referenced this issue Jul 24, 2023
SplitButton and MultiActionButton used to clone their children and pass particular props, including
refs - assuming each child was a Button component. This meant that the components failed to work
properly when using custom child components that wrap one or more Carbon Buttons (at least unless
forwardRef was used). This has now been replaced by a context-based approach using DOM selectors to
achieve the same functionality no matter how the children are composed.

fix #4784
robinzigmond added a commit that referenced this issue Aug 1, 2023
SplitButton and MultiActionButton used to clone their children and pass particular props, including
refs - assuming each child was a Button component. This meant that the components failed to work
properly when using custom child components that wrap one or more Carbon Buttons (at least unless
forwardRef was used). This has now been replaced by a context-based approach using DOM selectors to
achieve the same functionality no matter how the children are composed.

fix #4784
carbonci pushed a commit that referenced this issue Aug 4, 2023
### [119.9.3](v119.9.2...v119.9.3) (2023-08-04)

### Bug Fixes

* **split-button, multi-action-button:** remove children iteration ([a8631bc](a8631bc)), closes [#4784](#4784)
@carbonci
Copy link
Collaborator

carbonci commented Aug 4, 2023

🎉 This issue has been resolved in version 119.9.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

4 participants