Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(portable-text-editor): remove obsolete code #5393

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

skogsmaskin
Copy link
Member

@skogsmaskin skogsmaskin commented Dec 19, 2023

Description

After #5136 this code is no longer needed as the MutationObserver does what it is supposed to and verifies the selection properly.

There is also a bug in this removed code that doesn't take into account that the particular editor is focused and selected before removing all the DOM selection ranges, which has side effects in documents with several editors.

Notes for release

  • Improved selection handling for the Portable Text Editor when using several editors in the same document.

After #5136 this code is no longer needed as the MutationObserver actually does what it is supposed to.
There is also a bug in this code that doesn't take into account that the particular editor is focused and
selected before removing all the DOM selection ranges.
@skogsmaskin skogsmaskin requested review from a team and ninaandal and removed request for a team December 19, 2023 13:51
Copy link

vercel bot commented Dec 19, 2023

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

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

Copy link
Contributor

Package Documentation Change
sanity -3%
Full Report
@sanity/diff
This branch Next branch
13 documented 13 documented
16 not documented 16 not documented
@sanity/block-tools
This branch Next branch
4 documented 4 documented
9 not documented 9 not documented
@sanity/types
This branch Next branch
54 documented 54 documented
235 not documented 235 not documented
sanity/desk
This branch Next branch
85 documented 85 documented
60 not documented 60 not documented
@sanity/portable-text-editor
This branch Next branch
21 documented 21 documented
44 not documented 44 not documented
@sanity/mutator
This branch Next branch
7 documented 7 documented
4 not documented 4 not documented
@sanity/cli
This branch Next branch
1 documented 1 documented
31 not documented 31 not documented
@sanity/schema/_internal
This branch Next branch
0 documented 0 documented
9 not documented 9 not documented
@sanity/util/paths
This branch Next branch
1 documented 1 documented
15 not documented 15 not documented
sanity/router
This branch Next branch
17 documented 17 documented
26 not documented 26 not documented
@sanity/util/legacyDateFormat
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/schema
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
sanity/cli
This branch Next branch
2 documented 2 documented
0 not documented 0 not documented
@sanity/vision
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/util/fs
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
sanity/_internal
This branch Next branch
0 documented 0 documented
1 not documented 1 not documented
@sanity/util/content
This branch Next branch
1 documented 1 documented
5 not documented 5 not documented
sanity
This branch Next branch
169 documented 176 documented
839 not documented 846 not documented

Copy link
Contributor

Component Testing Report Updated Dec 19, 2023 1:56 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 14s 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) 16s 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

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@skogsmaskin skogsmaskin added this pull request to the merge queue Dec 19, 2023
Merged via the queue into next with commit e4bc20d Dec 19, 2023
40 checks passed
@skogsmaskin skogsmaskin deleted the refactor/pte-remove-obsolete branch December 19, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants