Skip to content

Commit

Permalink
use pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 20, 2024
1 parent 1e48af2 commit b2d0c01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are hidden
>
<svg
aria-hidden="true"
disabled=""
focusable="false"
height="24"
style="pointer-events: none;"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -49,9 +49,9 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
>
<svg
aria-hidden="true"
disabled=""
focusable="false"
height="24"
style="pointer-events: none;"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -72,9 +72,9 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
>
<svg
aria-hidden="true"
disabled=""
focusable="false"
height="24"
style="pointer-events: none;"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -95,9 +95,9 @@ exports[`BlockVerticalAlignmentUI should match snapshot when controls are visibl
>
<svg
aria-hidden="true"
disabled=""
focusable="false"
height="24"
style="pointer-events: none;"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ exports[`FullscreenModeClose when in full screen mode should display a default s
>
<svg
aria-hidden="true"
disabled=""
focusable="false"
height="36px"
style="pointer-events: none;"
viewBox="-2 -2 24 24"
width="36px"
xmlns="http://www.w3.org/2000/svg"
Expand Down
6 changes: 4 additions & 2 deletions packages/primitives/src/svg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ export const SVG = forwardRef(
clsx( className, { 'is-pressed': isPressed } ) || undefined,
'aria-hidden': true,
focusable: false,
// Safari does not obey `focusable`, but it does obey `disabled`.
disabled: true,
style: {
...props.style,
pointerEvents: /** @type {'none'} */ ( 'none' ),
},
};

// Disable reason: We need to have a way to render HTML tag for web.
Expand Down

0 comments on commit b2d0c01

Please sign in to comment.