fix(module:range-picker): clear outline on mouse leave - #9352
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9352 +/- ##
==========================================
- Coverage 92.09% 92.07% -0.02%
==========================================
Files 561 561
Lines 19652 19658 +6
Branches 3004 3005 +1
==========================================
+ Hits 18099 18101 +2
- Misses 1216 1220 +4
Partials 337 337 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR clears the hover outline effect in the range picker component when the mouse leaves the popup area. It addresses issue #6323 by ensuring that range selection visual feedback is properly cleared when the user moves their cursor away from the date picker.
- Adds a mouseleave event handler to the main popup container
- Implements
onLeave()method to emit the last selected date on mouse leave - Ensures proper cleanup of hover states for better user experience
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| onLeave(): void { | ||
| const lastSelectedDate = this.selectedValue.length > 0 ? this.selectedValue[this.selectedValue.length - 1] : void 0; |
There was a problem hiding this comment.
[nitpick] Using void 0 instead of undefined is unnecessarily obscure. Consider using undefined for better readability.
| const lastSelectedDate = this.selectedValue.length > 0 ? this.selectedValue[this.selectedValue.length - 1] : void 0; | |
| const lastSelectedDate = this.selectedValue.length > 0 ? this.selectedValue[this.selectedValue.length - 1] : undefined; |
| onLeave(): void { | ||
| const lastSelectedDate = this.selectedValue.length > 0 ? this.selectedValue[this.selectedValue.length - 1] : void 0; | ||
|
|
||
| this.cellHover.emit(lastSelectedDate); | ||
| } |
There was a problem hiding this comment.
The onLeave() method lacks documentation. Add a JSDoc comment explaining its purpose of clearing hover states when the mouse leaves the picker area.
4407a07 to
c92854e
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: close #6323
What is the new behavior?
Does this PR introduce a breaking change?
Other information