From 8a0e0af6496c901f19d86387c4c54d2f1bb982dc Mon Sep 17 00:00:00 2001 From: Mahmoud Elsayad Date: Mon, 17 Jun 2024 02:38:06 +0300 Subject: [PATCH 1/3] Enable Safari Shadow DOM fix for Safari 17. --- packages/slate-react/src/components/editable.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index 5b1f9b621f..ffd6e251d5 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -51,7 +51,6 @@ import { IS_WEBKIT, IS_UC_MOBILE, IS_WECHATBROWSER, - IS_SAFARI_LEGACY, } from '../utils/environment' import Hotkeys from '../utils/hotkeys' import { @@ -208,12 +207,7 @@ export const Editable = (props: EditableProps) => { const el = ReactEditor.toDOMNode(editor, editor) const root = el.getRootNode() - if ( - IS_SAFARI_LEGACY && - !processing.current && - IS_WEBKIT && - root instanceof ShadowRoot - ) { + if (!processing.current && IS_WEBKIT && root instanceof ShadowRoot) { processing.current = true const active = getActiveElement() @@ -500,12 +494,7 @@ export const Editable = (props: EditableProps) => { const el = ReactEditor.toDOMNode(editor, editor) const root = el.getRootNode() - if ( - IS_SAFARI_LEGACY && - processing?.current && - IS_WEBKIT && - root instanceof ShadowRoot - ) { + if (processing?.current && IS_WEBKIT && root instanceof ShadowRoot) { const ranges = event.getTargetRanges() const range = ranges[0] From 3de9a4899c7a3e5ace315a9757a8a07c6d612081 Mon Sep 17 00:00:00 2001 From: Mahmoud Elsayad <36645103+MahmoudElsayad@users.noreply.github.com> Date: Mon, 17 Jun 2024 03:00:44 +0300 Subject: [PATCH 2/3] Create weak-files-jam.md --- .changeset/weak-files-jam.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/weak-files-jam.md diff --git a/.changeset/weak-files-jam.md b/.changeset/weak-files-jam.md new file mode 100644 index 0000000000..f885e4b1bc --- /dev/null +++ b/.changeset/weak-files-jam.md @@ -0,0 +1,5 @@ +--- +"slate-react": minor +--- + +Enable Shadow DOM fix for all Safari versions. From a74845713864837d05111ca3773dd0819279499f Mon Sep 17 00:00:00 2001 From: Mahmoud Elsayad Date: Mon, 17 Jun 2024 03:17:12 +0300 Subject: [PATCH 3/3] Update changeset. --- .changeset/weak-files-jam.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/weak-files-jam.md b/.changeset/weak-files-jam.md index f885e4b1bc..3fd01bf943 100644 --- a/.changeset/weak-files-jam.md +++ b/.changeset/weak-files-jam.md @@ -1,5 +1,5 @@ --- -"slate-react": minor +'slate-react': minor --- Enable Shadow DOM fix for all Safari versions.