slate-react 0.72.4-2022010104916 → 0.72.4-2022010232655

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # slate-react
2
2
 
3
- ## 0.72.4-2022010104916
3
+ ## 0.72.4-2022010232655
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - [#4753](https://github.com/ianstormtaylor/slate/pull/4753) [`e9a46ad2`](https://github.com/ianstormtaylor/slate/commit/e9a46ad29e0376a45051c4a8100c5678784b785c) Thanks [@alessiogaldy](https://github.com/alessiogaldy)! - Fix "editor.insertText never gets called inside plugins on android"
8
8
 
9
+ * [#4755](https://github.com/ianstormtaylor/slate/pull/4755) [`8daa77e9`](https://github.com/ianstormtaylor/slate/commit/8daa77e9fab6b222ad796b420b86f3ec88999a39) Thanks [@jhurwitz](https://github.com/jhurwitz)! - fix useFocused hook
10
+
9
11
  ## 0.72.2
10
12
 
11
13
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,OAAO,EAAyB,UAAU,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;YACR,WAAW;WACZ,UAAU,EAAE;cACT,KAAK,CAAC,SAAS;sBACP,UAAU,EAAE,KAAK,IAAI;iBA6DxC,CAAA"}
1
+ {"version":3,"file":"slate.d.ts","sourceRoot":"","sources":["../packages/slate-react/src/components/slate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AACxE,OAAO,EAAyB,UAAU,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOpD;;;GAGG;AAEH,eAAO,MAAM,KAAK;YACR,WAAW;WACZ,UAAU,EAAE;cACT,KAAK,CAAC,SAAS;sBACP,UAAU,EAAE,KAAK,IAAI;iBAqExC,CAAA"}
package/dist/index.es.js CHANGED
@@ -3938,13 +3938,21 @@ var Slate = props => {
3938
3938
  setIsFocused(ReactEditor.isFocused(editor));
3939
3939
  });
3940
3940
  useIsomorphicLayoutEffect(() => {
3941
- var fn = () => setIsFocused(ReactEditor.isFocused(editor));
3941
+ var fn = () => {
3942
+ setTimeout(() => {
3943
+ setIsFocused(ReactEditor.isFocused(editor));
3944
+ }, 0);
3945
+ };
3942
3946
 
3943
3947
  document.addEventListener('focus', fn, true);
3944
3948
  return () => document.removeEventListener('focus', fn, true);
3945
3949
  }, []);
3946
3950
  useIsomorphicLayoutEffect(() => {
3947
- var fn = () => setIsFocused(ReactEditor.isFocused(editor));
3951
+ var fn = () => {
3952
+ setTimeout(() => {
3953
+ setIsFocused(ReactEditor.isFocused(editor));
3954
+ }, 0);
3955
+ };
3948
3956
 
3949
3957
  document.addEventListener('blur', fn, true);
3950
3958
  return () => document.removeEventListener('blur', fn, true);