I have a date picker field which I’d like to set to null/empty at the click of a button.
However, the field also can have an initial value from a collection.
If the date picker starts with an ‘init value’ when I click the clear button nothing happens.
When I start with a empty/null value, pick a date and then click the clear button it works as expected.
I’ve already went over
which helps when the init values don’t come from a collection, but doesn’t help when the init value comes from a collection.
How can I clear a date picker value after it already has a value from a collection?
Instead of binding to the collection directly bind to a variable and assign the collection value to the variable. Then you can clear the variable value to clear the input.