-
-
Notifications
You must be signed in to change notification settings - Fork 394
Description
I understand this might be controversial.
But, when min_lenght modifier is applied to an input field
<input type="search" data-model="min_lenght(3)|query" />As expected, the re-rendering won't fire until the value is 3 characters long. But, If one resets the field to 0 length, my expectation is that a re-render is fired to take the state of the page/component to the initial state.
Instead, nothing happens because min_lenght prevents that. That is particularly true if the "X" on the field of type search is not hidden.
If a user clicked on the "X", I think the expectation is to reset to the initial state, especially for a search field.
Would make more sense to apply the min_length constrain on anything above 0, or to give another parameter which allows to exclude 0 from it?
I haven't tried to see if using some workaround, like a live action or a onUpdated handler one can force the component to re-render if the value is changed to an empty string. I guess it can be done, but I wonder if this should not be a baked in the behaviour of the modifier itself.
All of the above, becomes even more complicated if this input field is a child component that is linked to the parent component through data-model props:props.