Form.Select - placeholder disappearing
See original GitHub issueI want select list where I can select null value
When I choose item from the list, placeholder disappearing
<Form.Select
name="parentId"
value={this.state.parentId}
options={options}
onChange={this.handleChange.bind(this)}
placeholder='Parent Id'
/>
When I trying add extra item with empty value, it’s not set as default.
options.push({
'key': '1',
'text': 'Parent Id',
'value': ''
})
How to make placeholder presist or set empty value as default?
Version
0.71.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Vue.js select placeholder disappears on input click
When I click ANY other input on the page, the select placeholders dissappear and they look like empty fields. If you click the...
Read more >Placeholder not disappearing after selection - WordPress.org
I'm currently using the Multiple Choice input field for my form, but for some reason, the placeholder won't disappear after selecting an option....
Read more >Dynamic Control added to PlaceHolder disappears on button ...
Hello Friends, I have a dropdown on page, a place holder and a save button on my form. Now, I am creating a...
Read more >:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any or element that is currently displaying placeholder text.
Read more >Mdb Select Form reset replaces placeholder to empty value
When we change value of selectbox (select a value) from HTML and then reset the value Then place holder disappears. Add comment. Arkadiusz...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, I’ve forgot to add
onChange
handler.How you want to reset value in another way? 🙃 Something should change the state.
I’ve copied behaviour to icon on
Dropdown
, so it resets value as in your example. However, it needs more styling and more logic because it’s not a SUI feature. See codepen.handleReset
setsvalue
tonull
.''
don’t accepted as value, there is already issue about this #1748.placeholder
behaviour is also was discussed there #1299. Contributions are welcome.@layershifter thx, but your example doesn’t work, when you select option, reset and try select again it doesn’t work
By the way, why I need separate button to clear select? it’s bad UI, normal select can handle both cases
If you preventing applying null value, you should provide some solution to easily reset select list with out some extra UI elements…