Repository navigation
Allow Dataform Select Box to have a custom empty option #70894
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
Merged
mikejolley
merged 2 commits into
trunk
from
update/dataform-option-custom-select-item-value
Jul 31, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we customized the default empty state by using the existing
field.label? If the field's label is "Date", the empty item could be "Select date" (lowercase and without an article to avoid grammar mistakes).Providing your own custom element would be a minor use case (fine to still support it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that could also work but there may be issues with casing?.
Do you want me to go ahead with adding
Select %s, or just merge this as is?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using sentence case here would be fine, at least I can't come up with an example where lowercasing the field's label would be problematic. In any case, this would be just the default. The field authors would be able to override it by providing its own empty state, if it was wrong – so that'd be fine.
Given is a small change, I think I'd do it in this PR to have a better default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oandregal Thinking about it some more I think it might be a worse default. There is no guarantee the label will be the noun. For a simplistic label like "Country", it would work as "Select country" but labels could be sentences. For example I could label my input "Select a country". That would in term make the default "Select select a country". I think this is too unpredictable. We should keep the generic term and leave the default in the hands of the consumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the labels I've seen in practice are a noun and, after this PR, there's the ability to override, so I don't think it'd be an issue.
It's fine if you'd rather ship this PR as it is, we can revisit this idea in the future should it come to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup lets do that 👍🏻 Thanks