Skip to content

Commit d36adee

Browse files
authored
fix(tooltip): make content inert when hidden (#2908)
* fix(tooltip): make content inert when hidden * docs: create small-trees-invite.md
1 parent 898848a commit d36adee

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/small-trees-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-tooltip>`: hide content when copy/pasting tooltip elements

elements/pf-tooltip/pf-tooltip.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#tooltip {
2222
--_timestamp-text-decoration: none;
2323
--_timestamp-text-underline-offset: initial;
24+
user-select: none;
2425
display: block;
2526
opacity: 0;
2627
pointer-events: none;
@@ -70,6 +71,7 @@
7071

7172
.open #tooltip {
7273
opacity: 1;
74+
user-select: initial;
7375
}
7476

7577
/* LEFT */

elements/pf-tooltip/pf-tooltip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class PfTooltip extends LitElement {
189189
aria-labelledby="tooltip">
190190
<slot id="invoker" @slotchange="${this.#invokerChanged}"></slot>
191191
</div>
192-
<div aria-hidden="${String(!open) as 'true' | 'false'}">
192+
<div ?inert="${!open}">
193193
<slot id="tooltip" name="content">${this.content}</slot>
194194
</div>
195195
</div>

0 commit comments

Comments
 (0)