Skip to content

Commit a71bfb7

Browse files
committed
fix(win95): issue on browser titles
1 parent 6d227f3 commit a71bfb7

3 files changed

Lines changed: 60 additions & 10 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
},
9696
"pnpm": {
9797
"patchedDependencies": {
98-
"@changesets/git@3.0.0": "patches/@changesets__git@3.0.0.patch"
98+
"@changesets/git@3.0.0": "patches/@changesets__git@3.0.0.patch",
99+
"react95@4.0.0": "patches/react95@4.0.0.patch"
99100
}
100101
}
101102
}

patches/react95@4.0.0.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
diff --git a/dist/common/hooks/useIsFocusVisible.js b/dist/common/hooks/useIsFocusVisible.js
2+
index 6a1444797a4db9e944016b9f14370fc87fca3e2c..834ea7bf902e1771b81a115ce981361ab8c8559a 100644
3+
--- a/dist/common/hooks/useIsFocusVisible.js
4+
+++ b/dist/common/hooks/useIsFocusVisible.js
5+
@@ -3,7 +3,6 @@
6+
Object.defineProperty(exports, '__esModule', { value: true });
7+
8+
var React = require('react');
9+
-var reactDom = require('react-dom');
10+
11+
let hadKeyboardEvent = true;
12+
let hadFocusVisibleRecently = false;
13+
@@ -78,9 +77,8 @@ function handleBlurVisible() {
14+
}
15+
function useIsFocusVisible() {
16+
const ref = React.useCallback((instance) => {
17+
- const node = reactDom.findDOMNode(instance);
18+
- if (node != null) {
19+
- prepare(node.ownerDocument);
20+
+ if (instance != null) {
21+
+ prepare(instance.ownerDocument);
22+
}
23+
}, []);
24+
return { isFocusVisible, onBlurVisible: handleBlurVisible, ref };
25+
diff --git a/dist/common/hooks/useIsFocusVisible.mjs b/dist/common/hooks/useIsFocusVisible.mjs
26+
index afef84458556114e4cb86c3a2c19ae5487305a30..53ac54aba13512d1f4ad4a667aa0a7c3a1863283 100644
27+
--- a/dist/common/hooks/useIsFocusVisible.mjs
28+
+++ b/dist/common/hooks/useIsFocusVisible.mjs
29+
@@ -1,5 +1,4 @@
30+
import { useCallback } from 'react';
31+
-import { findDOMNode } from 'react-dom';
32+
33+
let hadKeyboardEvent = true;
34+
let hadFocusVisibleRecently = false;
35+
@@ -74,9 +73,8 @@ function handleBlurVisible() {
36+
}
37+
function useIsFocusVisible() {
38+
const ref = useCallback((instance) => {
39+
- const node = findDOMNode(instance);
40+
- if (node != null) {
41+
- prepare(node.ownerDocument);
42+
+ if (instance != null) {
43+
+ prepare(instance.ownerDocument);
44+
}
45+
}, []);
46+
return { isFocusVisible, onBlurVisible: handleBlurVisible, ref };

pnpm-lock.yaml

Lines changed: 12 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)