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

[Fix]: Dropdown selected item parsing #730

Merged
merged 2 commits into from
May 26, 2023

Conversation

riitasointi
Copy link
Collaborator

Description

PR removes problematic code which tried to parse only the children text content of a selected <DropdownItem> into the Dropdown button element.

This logic created problems with elements like <FormattedMessage /> (from react-intl) and patterns like this

const Foo = () => 'This text will not show up in button when selected'
...
<DropdownItem>
   <Foo />
</DropdownItem>

PR also raises version to 10.0.3 for a hotfix release

Motivation and Context

This bug was reported by a user and severely affects their application

How Has This Been Tested?

Styleguidist, CRA with react-intl <FormattedMessage />

Screenshots (if appropriate):

image (8)

☝️ Initial bug report image

Release notes

Dropdown

  • Fix a bug where selected item text did not correctly appear in Dropdown button

@riitasointi riitasointi force-pushed the fix/dropdown-selected-item-parsing branch from 9de8bb2 to e84699f Compare May 26, 2023 12:05
@jenkrisu
Copy link
Collaborator

Tested also in Styleguidist with NVDA (Firefox, Edge, Chrome). ✔️

@riitasointi riitasointi merged commit 5e17750 into develop May 26, 2023
@riitasointi riitasointi deleted the fix/dropdown-selected-item-parsing branch May 26, 2023 12:15
@riitasointi riitasointi mentioned this pull request May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants