fix: allow FluentCombobox to be cleared from code #1613
Merged
+4
−5
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.
Pull Request
📖 Description
in #1485 it was made possible to set the selected value from code by implementing the OnParameterAsync for the FluentCombobox, however there was a small bug that prevented it from being cleared by code, and when null was set it would just revert back to the previous selection.
this fix allows it to be cleared by code when needed
Our use case was when we were clearing the form after a submit or pressing the reset button (which set the form to a new instance)
🎫 Issues
#1485
👩💻 Reviewer Notes
this can be tested by adding these buttons to
ComboboxWithOptionTemplate.razor
:my test scenario was :
📑 Test Plan
N/A afaik
if unit tests are needed to be added, i can look into this, but i couldn't find any combobox unit tests by the looks of it.
it might be better to see if they can be added imo
✅ Checklist
General
Component-specific
⏭ Next Steps
N/A