-
Notifications
You must be signed in to change notification settings - Fork 326
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
Tooltips fixes #12067
base: develop
Are you sure you want to change the base?
Tooltips fixes #12067
Conversation
🧪 Storybook is successfully deployed!📊 Dashboard:
|
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.
I miss some docs, otherwise is good to go.
@@ -13,14 +14,18 @@ import TooltipTrigger from '@/components/TooltipTrigger.vue' | |||
|
|||
const toggledOn = defineModel<boolean>({ default: undefined }) | |||
const props = defineProps<{ disabled?: boolean | undefined; title?: string | undefined }>() | |||
const tooltipTrigger = ref<typeof TooltipTrigger>() |
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.
Wait, so you don't need ComponentInstance
or ComponentExposed
here?
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.
Well, not really, tsc is happy 🤷🏻♂️ I added just for consistency.
if ( | ||
previousTooltip.value != null && | ||
!previousTooltip.value.entry.isHidden && | ||
previousTooltip.value.element.isConnected | ||
) { | ||
return previousTooltip.value | ||
} |
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.
Please add a comment explaining why we sometimes display the tooltip at the previous element - I think it's not obvious without the context of the bug you're fixing.
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.
Done
if (entriesSet) { | ||
for (const e of entriesSet) { | ||
if (e.key === key) entriesSet.delete(e) | ||
} | ||
} |
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.
We may have quite a lot of entries in this set - could it be a map?
Also, why didn't the previous approach work? In general I feel a bit more documentation would be helpful; for example I don't get why hoveredElements
is map of HTMLElement -> Set - do we have many tooltips registered for single HTML element?
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.
The set is usually just one element long. But in case of nested tooltip triggers (which are extremely rare) it can be longer.
Pull Request Description
Closes #10999
Fixes three issues with tooltips:
tooltips.mp4
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.