-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix: do not set placeholder to empty string by default #7573
Conversation
Looks like the change results in a regression: after deselecting all items, the original placeholder doesn't come back, and instead, the placeholder shows the last deselected item. Screen.Recording.2024-07-22.at.12.27.53.mov<vaadin-multi-select-combo-box placeholder="Placeholder"></vaadin-multi-select-combo-box>
<script>
const comboBox = document.querySelector('vaadin-multi-select-combo-box');
comboBox.items = ['Item 1'];
comboBox.selectedItems = ['Item 1'];
</script> |
Thanks, this actually is related to the fact that in your example (and the dev page) we use Added a fix for this case and updated tests to reproduce it (by replacing |
Looks like this didn't fix the regression completely. When deselecting all items without an initial placeholder, the placeholder doesn't clear and shows the last deselected item again. <vaadin-multi-select-combo-box></vaadin-multi-select-combo-box>
<script>
const comboBox = document.querySelector('vaadin-multi-select-combo-box');
comboBox.items = ['Item 1'];
comboBox.selectedItems = ['Item 1'];
</script> |
Thanks, fixed and added a test with setting |
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.5.0.alpha6 and is also targeting the upcoming stable 24.5.0 version. |
Description
Fixes #7551
Changed to align with
InputControlMixin
by removing default empty string value, so that we don't haveplaceholder
attribute set by default. Also fixed the logic for restoring placeholder property in selected items observer.Note, the property has
reflectToAttribute
so technically setting empty string can still cause that to happen (which is the case for all input fields). I don't think we can easily fix that without a breaking change.Type of change