enhance menu-item with externalLink prop to show links with icon and … #24713
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I introduced a new prop for the menu-item and the button, called externalLink. It is an indicator if the menu-item/button is used as an external link which needs to have a icon (external) and a visually hidden text for screenreader users.
If the prop is set to true, the menu-item clones the external icon which is imported to the current icon, because there should be only one icon displayed and gives the new icon and externalLink prop to the button. The button displays now the the external icon and the visually hidden text, on an a or button tag.
This is an alternative proposal for issue #24539
How has this been tested?
Open gutenberg editor for a page and the new FSE-Editor.
Open the "more option" menu and check/click the help button.
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: