From 4e85cd90d9a107eb34e40d333bf82fefc487e9e1 Mon Sep 17 00:00:00 2001 From: Nina Andal Aarvik Date: Wed, 10 Apr 2024 14:33:26 +0200 Subject: [PATCH 1/3] fix(core): set scroll boundary to nearest --- .../inputs/PortableText/hooks/useScrollSelectionIntoView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx index b45601a04d0..bbf797ada23 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx @@ -16,7 +16,7 @@ export function useScrollSelectionIntoView(scrollElement: HTMLElement | null) { scrollIntoView(leafEl, { scrollMode: 'if-needed', boundary: scrollElement, - block: 'start', + block: 'nearest', inline: 'nearest', }) } From 3f738242f4ac508707fe81990ad1c15af0c40766 Mon Sep 17 00:00:00 2001 From: Nina Andal Aarvik Date: Thu, 11 Apr 2024 12:41:56 +0200 Subject: [PATCH 2/3] fix(core): add smooth scroll behavior --- .../inputs/PortableText/hooks/useScrollSelectionIntoView.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx index bbf797ada23..b09c633440d 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx @@ -14,6 +14,7 @@ export function useScrollSelectionIntoView(scrollElement: HTMLElement | null) { return } scrollIntoView(leafEl, { + behavior: 'smooth', scrollMode: 'if-needed', boundary: scrollElement, block: 'nearest', From 772e4c7a8e9ed851cb55b4c0e7f873a3441db7ad Mon Sep 17 00:00:00 2001 From: RitaDias Date: Fri, 26 Apr 2024 08:27:09 +0200 Subject: [PATCH 3/3] fix(sanity): remove smooth behavior --- .../inputs/PortableText/hooks/useScrollSelectionIntoView.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx index b09c633440d..bbf797ada23 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/hooks/useScrollSelectionIntoView.tsx @@ -14,7 +14,6 @@ export function useScrollSelectionIntoView(scrollElement: HTMLElement | null) { return } scrollIntoView(leafEl, { - behavior: 'smooth', scrollMode: 'if-needed', boundary: scrollElement, block: 'nearest',