-
Notifications
You must be signed in to change notification settings - Fork 273
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
ui5-datetime-picker: "Error" value-state cleared on change #4684
Comments
Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository. |
Can you check this issue @SAP/ui5-webcomponents-topic-b it is reproducible although the sample is with the react wrappers. I think it won't take much to re-create it with pure ui5-webcomps. |
Here is a demonstration of the issue with pure ui5-webcomponents The breaking change seems to have been introduced between 1.0.0-rc.15 and 1.0.0-rc.16 |
The issue seems to be caused by this line: https://github.com/SAP/ui5-webcomponents/blob/master/packages/main/src/DatePicker.js#L549 (Error value state being changed to None) Is there any update on a fix? |
Hello @ee92 , Sorry for the late response! Have you tried to prevent the default behaviour of the control? The change and input events of the DatePicker are preventable, this will prevent the change of the value and the internal verification, so you will have the full control over the value change and the value state change. You will still receive the value in the event and that the value is changed, but if you prevent it, the value and the value state won't be touched by the control itself. Can you please verify if this will fix your issue? Best Regards, |
@tsanislavgatev the issue is not fixed by using |
Screen.Recording.2022-04-27.at.10.48.42.mov@ee92 Hello, The method you are refering to is called after we check if the event is prevented.
And then called here:
Can you please check the behaviour again? Best Regards, |
This is true for DatePicker, but not for DateTimePicker. I updated the ticket description with a new sandbox that uses DateTimePicker instead. Just by looking at the code you can see this line runs unconditionally:
We had no issue with this previous to upgrading to 1.x.x so hoping that the solution does not require preventing the event. Thanks |
Hello, The change that introduced the secondary check is to improve the checks that the component provides. The control itself provides a bahaviour with predefined validations of dates, ranges, formats of date/time. It comes by default with the control, that's why you receive this removing of the value state. Because of this we've introduced the preventable behaviour, for the developers who don't need our checks, to give them the opportunity to implement their validation and value setting. That's why we are talking about preventing the default behaviour and why we decided to provide a full control option. Best Regards, |
Bug Description
The datetime picker reverts "Error" value-state back to "None" when a valid date is selected.
This only happens for "Error" and not for "Warning", "Information", or "Success".
Expected Behavior
Expect to be able to set the valueState to "Error" programmatically based on custom validation, without the component reverting it to "None" for what it considers is a valid date.
Steps to Reproduce
Steps to reproduce the behavior:
Context
Priority
Stakeholder Info (if applicable)
Thanks for taking a look!
The text was updated successfully, but these errors were encountered: