sanity
sanity copied to clipboard
fix(pte): focus error in readonly editor
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.
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 |
No changes to documentation
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 |
It's not possible to reproduce this issue anymore. Closing pull request.