mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-27 22:55:56 +08:00
Inserting and deleting the CSS ':focus' rule triggers styles recalculation for the entire DOM tree which results in performance degradation on focus and makes the keyboard very slow to open in Safari iOS. This commit fixes the issue by picking up the upstream changes to the W3C focus-visible polyfill. A class name is applied to elements when they receive focus via keyboard. The related CSS rule is inserted only once into the style sheet. This performs much better since the browser needs to recalculate styles only for the focused element and its small subtree. Fix #1155 Close #1169