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

Allow the option labels of NullableBooleanInput to be customized #5311

Merged
merged 3 commits into from
Oct 1, 2020

Conversation

gavacho
Copy link

@gavacho gavacho commented Sep 28, 2020

Hi, I would like to customize the labels of the options of the NullableBooleanInput control.

@fzaninotto
Copy link
Member

Why don't you want to use the current solution (using translation messages)?

@gavacho
Copy link
Author

gavacho commented Sep 28, 2020

@fzaninotto I have two different NullableBooleanInputs in my app and want to use different labels on them.

@gavacho
Copy link
Author

gavacho commented Sep 28, 2020

@fzaninotto The default behavior of this control is to display 3 items, the item representing the null item has a blank label. That item, while present in the dropdown, is very difficult to select.

This has created confusion in the past. For example, this PR #4365 is addressing a problem that doesn't exist (because the null option is always rendered by NullableBooleanInput).

Maybe NullableBooleanInput should guard against the case of the translation message being an empty string.

@fzaninotto
Copy link
Member

PR #5326 should solve the bug of the null option not being visible enough.

docs/Inputs.md Show resolved Hide resolved
docs/Inputs.md Outdated Show resolved Hide resolved
@gavacho gavacho force-pushed the nullable-boolean-labels branch 2 times, most recently from ab31316 to b7c6c4f Compare September 30, 2020 19:22
@gavacho
Copy link
Author

gavacho commented Sep 30, 2020

Oops, I just realized this was opened against the master branch upstream. Shall I re-open against next?

@djhi
Copy link
Contributor

djhi commented Oct 1, 2020

Oops, I just realized this was opened against the master branch upstream. Shall I re-open against next?

The next release will be 3.9 and we already moved the related code to master so you're fine :)

@fzaninotto fzaninotto merged commit 006bd59 into marmelab:master Oct 1, 2020
@fzaninotto
Copy link
Member

Perfect, thanks a lot!

@fzaninotto fzaninotto added this to the 3.9.0 milestone Oct 1, 2020
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.

3 participants