sanity icon indicating copy to clipboard operation
sanity copied to clipboard

fix(pte): focus error in readonly editor

Open pedrobonamin opened this issue 1 year ago • 3 comments

Description

When the PTE editor is in readOnly mode the onBlur event is not triggered when opening a internal dialog, for example, when we want to edit an inner object. This is causing that when clicking on other object, the focus or selection of the PTE editor changes and creates a strange behaviour, focusing on multiple elements at the same time and showing an error in the screen.

With this changes, I'm disabling the selection when the editor is in readOnly mode.

What to review

Is there anything to consider in why we would want to keep the selection in the readOnly mode? Is there a way to trigger the onBlur event even though the editor is in readOnly mode?

Notes for release

Fixes issue in which the PTE editor throws an error when opening dialogs if the user is viewing old documents.

pedrobonamin avatar Nov 28 '23 18:11 pedrobonamin

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Nov 28, 2023 6:32pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 6:32pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Nov 28, 2023 6:32pm

vercel[bot] avatar Nov 28 '23 18:11 vercel[bot]

No changes to documentation

github-actions[bot] avatar Nov 28 '23 18:11 github-actions[bot]

Component Testing Report Updated Nov 28, 2023 6:36 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 15s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 3s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 6s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 17s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 8s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 39s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 6s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 3s 3 0 0

github-actions[bot] avatar Nov 28 '23 18:11 github-actions[bot]

It's not possible to reproduce this issue anymore. Closing pull request.

pedrobonamin avatar Mar 04 '24 09:03 pedrobonamin