Skip to content

Commit

Permalink
Merge pull request #164 from element-hq/florianduros/tooltip-data-att…
Browse files Browse the repository at this point in the history
…ribute

Tooltip: Remove useless data-state
  • Loading branch information
florianduros authored May 2, 2024
2 parents 6b80f98 + fa10434 commit b033115
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exports[`ActionInput > renders 1`] = `
aria-controls=":r0:"
aria-label="Click me!"
class="_action_1689d3"
data-state="closed"
type="button"
>
<svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ exports[`PasswordControl > switches the input type > invisible 1`] = `
aria-controls=":r0:"
aria-label="Show"
class="_action_1689d3"
data-state="closed"
type="button"
>
<svg
Expand Down Expand Up @@ -52,7 +51,6 @@ exports[`PasswordControl > switches the input type > invisible 2`] = `
aria-describedby=":r3:"
aria-label="Show"
class="_action_1689d3"
data-state="open"
type="button"
>
<svg
Expand Down Expand Up @@ -89,7 +87,6 @@ exports[`PasswordControl > switches the input type > visible 1`] = `
aria-describedby=":r3:"
aria-label="Hide"
class="_action_1689d3"
data-state="open"
type="button"
>
<svg
Expand Down
1 change: 0 additions & 1 deletion src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ function TooltipAnchor({ children }: Readonly<PropsWithChildren>): JSX.Element {
context.getReferenceProps({
ref,
...children.props,
"data-state": context.open ? "open" : "closed",
}),
);
}
8 changes: 1 addition & 7 deletions src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ exports[`Tooltip > opens tooltip on focus where trigger is non interactive 1`] =
style="padding: 100px;"
>
<span
data-state="closed"
tabindex="0"
>
<button
Expand Down Expand Up @@ -134,7 +133,6 @@ exports[`Tooltip > overrides default tab index for non interactive triggers 1`]
style="padding: 100px;"
>
<span
data-state="closed"
tabindex="-1"
>
<button
Expand Down Expand Up @@ -179,9 +177,7 @@ exports[`Tooltip > renders closed by default 1`] = `
<div
style="padding: 100px;"
>
<span
data-state="closed"
>
<span>
No tooltip to see here
</span>
</div>
Expand Down Expand Up @@ -237,7 +233,6 @@ exports[`Tooltip > renders open by default 1`] = `
<button
aria-describedby=":r2:"
class="_icon-button_e3253e"
data-state="open"
data-testid="testbutton"
role="button"
style="--cpd-icon-button-size: 32px;"
Expand Down Expand Up @@ -319,7 +314,6 @@ exports[`Tooltip > renders with caption 1`] = `
>
<button
class="_icon-button_e3253e"
data-state="closed"
data-testid="testbutton"
role="button"
style="--cpd-icon-button-size: 32px;"
Expand Down

0 comments on commit b033115

Please sign in to comment.