Add emptyText prop to SelectArrayInput with tests and documentatio#11171
Open
syedaliazzam wants to merge 1 commit intomarmelab:masterfrom
Open
Add emptyText prop to SelectArrayInput with tests and documentatio#11171syedaliazzam wants to merge 1 commit intomarmelab:masterfrom
syedaliazzam wants to merge 1 commit intomarmelab:masterfrom
Conversation
slax57
requested changes
Feb 27, 2026
Contributor
slax57
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
As this is a new feature, this PR needs to target the next branch instead of master.
Also, please update the documentation, and the storybook.
Also, I partially disagree with the implementation. To me, the empty text should be rendered when there are no options available, but not all the time. Otherwise it seems a bit odd to have both a message saying 'No selection available' and options below it.
And one last thing: the prop should support translation keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
SelectArrayInputcomponent did not support displaying a placeholder or empty state when no selection was made, unlikeSelectInput, which has anemptyTextprop. This made it difficult to provide user guidance or indicate that no options are available in multi-select dropdowns.Solution
This PR introduces an
emptyTextprop toSelectArrayInput. When provided, a disabledMenuItemwith theemptyTextvalue is rendered at the top of the dropdown. This matches the behavior ofSelectInputand improves the user experience for forms usingSelectArrayInput.emptyTextprop toSelectArrayInputand its type definition.MenuItemwith theemptyTextvalue when provided.emptyTextprop works as expected.SelectArrayInput.How To Test
SelectArrayInputcomponent and pass theemptyTextprop: