From 2dd25347babd25eb604f9c4f1cc280d775a5556e Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Wed, 13 Dec 2023 12:48:03 +0100 Subject: [PATCH 1/2] fix(portable-text-editor): fix safari focus issue on empty editor Signed-off-by: Fred Carlsen --- packages/@sanity/portable-text-editor/src/editor/Editable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@sanity/portable-text-editor/src/editor/Editable.tsx b/packages/@sanity/portable-text-editor/src/editor/Editable.tsx index e350175e472..2d172cf0b87 100644 --- a/packages/@sanity/portable-text-editor/src/editor/Editable.tsx +++ b/packages/@sanity/portable-text-editor/src/editor/Editable.tsx @@ -166,10 +166,10 @@ export const PortableTextEditable = forwardRef(function PortableTextEditable( if (renderPlaceholder && lProps.leaf.placeholder && lProps.text.text === '') { return ( <> + {rendered} {renderPlaceholder()} - {rendered} ) } From 584e0fbe2934663cfbff8b1affa5aa883f472a5e Mon Sep 17 00:00:00 2001 From: Fred Carlsen Date: Wed, 13 Dec 2023 13:41:37 +0100 Subject: [PATCH 2/2] fixup! fix(portable-text-editor): fix safari focus issue on empty editor Signed-off-by: Fred Carlsen --- .../__tests__/PortableTextEditor.test.tsx | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/packages/@sanity/portable-text-editor/src/editor/__tests__/PortableTextEditor.test.tsx b/packages/@sanity/portable-text-editor/src/editor/__tests__/PortableTextEditor.test.tsx index 39e632490b6..5e85a72168b 100644 --- a/packages/@sanity/portable-text-editor/src/editor/__tests__/PortableTextEditor.test.tsx +++ b/packages/@sanity/portable-text-editor/src/editor/__tests__/PortableTextEditor.test.tsx @@ -61,12 +61,6 @@ describe('initialization', () => { - - Jot something down here - @@ -78,6 +72,12 @@ describe('initialization', () => {
+ + Jot something down here + @@ -286,14 +286,6 @@ describe('initialization', () => { type: 'unset', }, ], - i18n: { - action: 'inputs.portable-text.invalid-value.disallowed-type.action', - description: 'inputs.portable-text.invalid-value.disallowed-type.description', - values: { - key: '123', - typeName: 'banana', - }, - }, }, }) }) @@ -339,14 +331,6 @@ describe('initialization', () => { patches: [ {path: [{_key: 'abc'}, 'children', {_key: 'def'}, 'marks'], type: 'set', value: []}, ], - i18n: { - action: 'inputs.portable-text.invalid-value.orphaned-marks.action', - description: 'inputs.portable-text.invalid-value.orphaned-marks.description', - values: { - key: 'abc', - orphanedMarks: ['invalid'], - }, - }, }, type: 'invalidValue', value: [