Skip to content

Commit

Permalink
fix: escape current selector for focusable (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaRybkina authored Jun 14, 2023
1 parent 3397132 commit 00b789b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/_rules/focus-ring.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export const focusRing = [
}
return `.${escapedSelector}:${selectorWithVariant.split(':')?.[0]}{${focusRingStyle}}`;
} else {
const focus = `.${currentSelector}:focus,.${currentSelector}:focus-visible{${focusRingStyle}}`;
const notFocusVisible = `.${currentSelector}:not(:focus-visible){${outlineNone}}`;
const escapedCurrentSelector = escapeSelector(currentSelector);
const focus = `.${escapedCurrentSelector}:focus,.${escapedCurrentSelector}:focus-visible{${focusRingStyle}}`;
const notFocusVisible = `.${escapedCurrentSelector}:not(:focus-visible){${outlineNone}}`;
return focus + notFocusVisible;
}
}],
Expand Down

0 comments on commit 00b789b

Please sign in to comment.