Skip to content
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

fix(ui5-date-picker): setting value before firing event #3629

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

tsanislavgatev
Copy link
Contributor

fixes: #3516

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tsanislavgatev the change, although making "get dateValue" work properly as before, because the value would be updated upfront, will lead to the following issue:

----- before the event - we update the value

----- in the event handler - the app developer prevents the event and can set "value" and "value-state"

----- after the event is fired - if the event is prevented we change the value to its previous state, overwriting what the app developer set in the event handler

How to fix the issue and overcome the above problem:
introduce new private field/property to store the "live value" (what the user has selected ) and use that one in the "get dateValue" (this way the getter will work and return the most recent value) and don't update the "value" upfront (as it was prior to this change) not to overwrite changes that may occur in the event handler.

@ilhan007
Copy link
Member

I meant exactly this, I will test the change and will give +1 afterwards if everything is fine

@ilhan007 ilhan007 merged commit bee34da into master Aug 23, 2021
@ilhan007 ilhan007 deleted the date-picker-prevent-default-improvement branch August 23, 2021 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SF][DataPicker] - DataPicker's internal validation reset valueState unexpectedly
2 participants