-
Notifications
You must be signed in to change notification settings - Fork 264
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
feat(ui5-date-picker): introduce value-state-change event #8133
Conversation
related to: #7444 |
Everything good so far, the only thing I would like to discuss briefly next week is if we have to rather update the this.valueState before firing the event and later revert its value if the event is prevented. Or, to keep it like it is. I think in other components we have done the first, but still worth discussing it briefly. |
Hi colleagues, @hinzzx as I mentioned previously, I wanted to discuss one detail before enforcing it as a review comment. |
Thank you! I don't have any further comments, I will leave to @tsanislavgatev to also review/test/approve/merge the change. |
Currently in our
<ui5-date-picker>
component we have internal validation regardingvalue-state
, which was setting upValueState.Error
/ValueState.None
whenever the value in the component was invalid/valid.The problem here is that when an app developer sets the
value-state
property explicitly it was being overwritten by the control, which is not always the expected behaviour.To address this problem we are introducing the
value-state-change
event, which is fired before the internal validation/invalidation of the component. It is preventable, so when the app developer wants to take care of the state management of the component, they just prevent the event.Behaviour with event prevented, and explicitly set valueState property to Error:
Behaviour without event being prevented, and explicitly set valueState property to Error:
Fixes: #8005