Skip to content

Commit

Permalink
Prevent closing tooltips from closing collecction share dialog (#1579)
Browse files Browse the repository at this point in the history
Fixes #1553
  • Loading branch information
SuaYoo authored and ikreymer committed Mar 6, 2024
1 parent 2c1d893 commit 04b081e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/src/components/ui/copy-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export class CopyButton extends LitElement {
? this.content
: msg("Copy")}
?hoist=${this.hoist}
@sl-hide=${this.stopProp}
@sl-after-hide=${this.stopProp}
>
<sl-icon-button
name=${this.isCopied ? "check-lg" : this.name ? this.name : "files"}
Expand All @@ -82,4 +84,13 @@ export class CopyButton extends LitElement {
button?.blur(); // Remove focus from the button to set it back to its default state
}, 3000);
}

/**
* Stop propgation of sl-tooltip events.
* Prevents bug where sl-dialog closes when tooltip closes
* https://github.com/shoelace-style/shoelace/issues/170
*/
private stopProp(e: Event) {
e.stopPropagation();
}
}

0 comments on commit 04b081e

Please sign in to comment.