-
Notifications
You must be signed in to change notification settings - Fork 330
fix(calendar-view): [calendar-view] fix popper cant mouse enter #3218
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,18 +57,17 @@ export const handleMouseenter = | |
| ($event, val) => { | ||
| const tooltip = vm.$refs.tooltip | ||
| tooltip.state.referenceElm = $event.target | ||
| tooltip.state.popperElm && (tooltip.state.popperElm.style.display = 'none') | ||
| tooltip.doDestroy() | ||
|
|
||
| state.eventTipContent = val | ||
| state.eventTipVisible = true | ||
| setTimeout(tooltip.updatePopper, 20) | ||
| setTimeout(tooltip.show(), 20) | ||
| } | ||
|
|
||
| export const handleMouseleave = | ||
| ({ state }) => | ||
| ({ vm }) => | ||
| () => { | ||
| state.eventTipVisible = false | ||
| const tooltip = vm.$refs.tooltip | ||
| tooltip.setExpectedState(false) | ||
| tooltip.debounceClose() | ||
| } | ||
|
Comment on lines
+66
to
71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed tooltip hover issue with improved close mechanism. This is the core of the fix. By changing the mouse leave handler to:
This allows users to move their mouse from the event item onto the tooltip before it closes, fixing the "popper cant mouse enter" issue. |
||
|
|
||
| export const isSelectedDate = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,6 @@ | ||
| <template> | ||
| <div data-tag="tiny-calendar-view" class="w-full h-auto"> | ||
| <tiny-tooltip | ||
| ref="tooltip" | ||
| v-model="state.eventTipVisible" | ||
| popper-class="absolute max-w-[theme(spacing.80)]" | ||
| :manual="true" | ||
| effect="light" | ||
| placement="right" | ||
| > | ||
| <tiny-tooltip ref="tooltip" popper-class="absolute max-w-[theme(spacing.80)]" effect="light" placement="right"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improved tooltip interaction by removing visibility binding and manual control. The removal of |
||
| <template #content> | ||
| <div class="p-2 max-h-[80vh] overflow-auto"> | ||
| <div class="px-1.5 mb-1.5 border-l-2 border-color-brand">{{ state.eventTipContent.title }}</div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,8 @@ | |
| day.isLast || day.isNext | ||
| ? 'is-next-or-last' | ||
| : isToday(day) || isSelectedDate(day) | ||
| ? 'is-selected' | ||
| : '', | ||
| ? 'is-selected' | ||
| : '', | ||
| day.disabled ? 'is-disabled' : '' | ||
| ]" | ||
| > | ||
|
|
@@ -212,14 +212,7 @@ | |
| </ul> | ||
| </div> | ||
| </div> | ||
| <tiny-tooltip | ||
| ref="tooltip" | ||
| v-model="state.eventTipVisible" | ||
| popper-class="tiny-calendar-view-tooltip" | ||
| :manual="true" | ||
| effect="light" | ||
| placement="right" | ||
| > | ||
| <tiny-tooltip ref="tooltip" popper-class="tiny-calendar-view-tooltip" effect="light" placement="right"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improved tooltip interaction by removing visibility binding and manual control. The removal of |
||
| <template #content> | ||
| <div class="tooltip-main"> | ||
| <div class="title">{{ state.eventTipContent.title }}</div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
setTimeout(tooltip.show(), 20)might cause unexpected behavior becausetooltip.show()is executed immediately, andsetTimeoutwill receive its return value, not the function itself. Consider passing the function reference:setTimeout(() => tooltip.show(), 20). This ensurestooltip.show()is called after the delay.