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(ktooltip, klabel): remove tooltip slot wrapper #1785

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/components/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
**KTooltip** is a tooltip component that is used when you need a simple label to be displayed when hovering over an element. KTooltip has a single slot that takes in the element that you want the tooltip to trigger over. At least the label prop must be passed in for the tooltip to display anything. For example a button:

<KTooltip label="Video Games">
<KButton>🎮</KButton>
<KButton>What is your hobby?</KButton>
</KTooltip>

```html
<KTooltip label="Video Games">
<KButton>🎮</KButton>
<KButton>What is your hobby?</KButton>
</KTooltip>
```

Expand Down
1 change: 1 addition & 0 deletions src/components/KLabel/KLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<InfoIcon
class="tooltip-trigger-icon"
:color="`var(--kui-color-text-neutral, ${KUI_COLOR_TEXT_NEUTRAL})`"
tabindex="0"
/>
<template #content>
<slot name="tooltip">{{ info }}</slot>
Expand Down
4 changes: 1 addition & 3 deletions src/components/KTooltip/KTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
trigger="hover"
width="auto"
>
<div :tabindex="$slots.default ? '0' : '-1'">
<slot />
</div>
<slot />

<template
v-if="showTooltip"
Expand Down
Loading