mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 11:09:13 +00:00
fix tooltip positioning
This commit is contained in:
@@ -10,6 +10,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
|
||||
|
||||
- CodePen examples will now open in light or dark depending on your current preference
|
||||
- Fixed a bug where tag names weren't being generated in `vscode.html-custom-data.json` [#593](https://github.com/shoelace-style/shoelace/pull/593)
|
||||
- Fixed a bug in `<sl-tooltip>` where the tooltip wouldn't reposition when content changed
|
||||
- Upgraded the status of `<sl-qr-code>` from experimental to stable
|
||||
|
||||
## 2.0.0-beta.61
|
||||
|
||||
@@ -269,6 +269,13 @@ export default class SlTooltip extends LitElement {
|
||||
this.syncOptions();
|
||||
}
|
||||
|
||||
@watch('content')
|
||||
handleContentChange() {
|
||||
if (this.popover && this.open) {
|
||||
this.popover.update();
|
||||
}
|
||||
}
|
||||
|
||||
@watch('disabled')
|
||||
handleDisabledChange() {
|
||||
if (this.disabled && this.open) {
|
||||
@@ -331,7 +338,7 @@ export default class SlTooltip extends LitElement {
|
||||
role="tooltip"
|
||||
aria-hidden=${this.open ? 'false' : 'true'}
|
||||
>
|
||||
<slot name="content">${this.content}</slot>
|
||||
<slot name="content" @slotchange=${this.handleContentChange}> ${this.content} </slot>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user