Skip to content

fix: fire change event on arrow keys when step >= 1 - #6421

Merged
vursen merged 1 commit into
mainfrom
fix/time-picker/fire-change-event-on-arrow-keys
Aug 29, 2023
Merged

vursen merged 1 commit into
mainfrom
fix/time-picker/fire-change-event-on-arrow-keys

Conversation

@vursen

@vursen vursen commented Aug 29, 2023 •

Copy link
Copy Markdown
Contributor

Description

The PR fixes the regression introduced in #6408 which caused the change event not to be fired when step >= 1.

Type of change

  • Bugfix

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication


// Mark value set programmatically by the user
// as committed for the change event detection.
if (!this.__skipCommittedValueUpdate) {

@vursen vursen Aug 29, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's important to execute this part before __updateInputValue(). When step >= 1, __updateInputValue() can trigger the value observer again while its first call is still executing, resulting in nested calls. As a result of nested calls, __skipCommittedValueUpdate can become false by the time the code execution returns to the first call.

@vursen
vursen requested a review from web-padawan August 29, 2023 13:39
@vursen vursen added the regression Sometimes we make things break label Aug 29, 2023
@vursen
vursen merged commit 30a6204 into main Aug 29, 2023
@vursen
vursen deleted the fix/time-picker/fire-change-event-on-arrow-keys branch August 29, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

regression Sometimes we make things break

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants