Skip to content

Commit

Permalink
Disable the focus ring of the opened popup
Browse files Browse the repository at this point in the history
This is to avoid an issue on some browsers (Safari iOS) where the focus
ring was visible, even when opening the popup with a touch event.

This is not an issue since the popup being opened is already an
indicator that it has received the focus.
  • Loading branch information
bpierre committed Oct 28, 2023
1 parent 8421cb8 commit c56e4da
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions src/Popup.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { globalStyle, style } from "@vanilla-extract/css";
export const main = style({
zIndex: 999, // 999 should be enough since the portal target can be changed
overflow: "hidden",
outlineWidth: 2,
outline: 0,

// transition styles
opacity: 0,
Expand All @@ -12,10 +12,6 @@ export const main = style({
transitionDuration: "100ms",
transitionTimingFunction: "cubic-bezier(0, 0.5 0.5, 1)",
pointerEvents: "none",

":focus-visible": {
outlineStyle: "solid",
},
});

globalStyle(`${main}, ${main} *`, {
Expand Down
1 change: 0 additions & 1 deletion src/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export function Popup({
left,
background: th.popupBackground,
borderRadius: th.popupRadius,
outlineColor: th.focusColor,
boxShadow: th.popupShadow,
}}
>
Expand Down

0 comments on commit c56e4da

Please sign in to comment.