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

fix(core): fix copy related issues #7394

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Conversation

sjelfull
Copy link
Member

@sjelfull sjelfull commented Aug 20, 2024

Description

This fixes a few issues related to copy paste:

Referenced could not open when you had a reference field inside a field group and was not on the All fields tab. The fix here was to remove the onBlur handler. I'm not entirely sure why this breaks inside a group, since I could only reproduce in a newly installed studio and not inside the monorepo. Having a blur handler here is a footgun, and doesn't make sense given that we don't want to change the focused path until you click another field.

Fixes #7265

It was also not possible to copy selected text in a textarea, since the Copy action was triggered and copied the full field content to the clipboard. Text areas should now be ignored.

What to review

  • That copying selected text in a textarea works
  • That a reference can open inside a group

Notes for release

  • Fixes an issue where references would not open if clicked on inside a Field Group
  • Fixes an issue where it wasn't possible to copy a text selection inside a text area field

Removes blur handler on reference preview. This is a unnecessary footgun, and it is triggered because focus will change to the first element in the opened reference pane.

It isn’t clear why this only happens inside groups, though, so might dig more into that.

Fixes #7265

Signed-off-by: Fred Carlsen <[email protected]>
@sjelfull sjelfull self-assigned this Aug 20, 2024
@sjelfull sjelfull requested a review from a team as a code owner August 20, 2024 12:28
@sjelfull sjelfull requested review from juice49 and removed request for a team August 20, 2024 12:28
Copy link

vercel bot commented Aug 20, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 0:28am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 0:28am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 0:28am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 0:28am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 0:28am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Aug 20, 2024 0:28am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Aug 20, 2024 12:46 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 37s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 44s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 45s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 14s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 8s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 25s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 14s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 1m 48s 30 0 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 19s 3 0 0

Copy link
Contributor

@ricokahler ricokahler left a comment

Choose a reason for hiding this comment

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

nice nice!

@sjelfull sjelfull added this pull request to the merge queue Aug 20, 2024
Merged via the queue into next with commit 49083dd Aug 20, 2024
42 checks passed
@sjelfull sjelfull deleted the fix/ignore-copy-readonly-inputs branch August 20, 2024 13:02
cngonzalez pushed a commit that referenced this pull request Aug 20, 2024
* fix(core): ignore all input/textarea elements when copying

fixes sdx-1591

Signed-off-by: Fred Carlsen <[email protected]>

* fix(core): fix blur issue for references inside groups

Removes blur handler on reference preview. This is a unnecessary footgun, and it is triggered because focus will change to the first element in the opened reference pane.

It isn’t clear why this only happens inside groups, though, so might dig more into that.

Fixes #7265

Signed-off-by: Fred Carlsen <[email protected]>

---------

Signed-off-by: Fred Carlsen <[email protected]>
@DavithkbY
Copy link

This issue is still not fixed, see my comment on #7265

jordanl17 pushed a commit that referenced this pull request Aug 29, 2024
* fix(core): ignore all input/textarea elements when copying

fixes sdx-1591

Signed-off-by: Fred Carlsen <[email protected]>

* fix(core): fix blur issue for references inside groups

Removes blur handler on reference preview. This is a unnecessary footgun, and it is triggered because focus will change to the first element in the opened reference pane.

It isn’t clear why this only happens inside groups, though, so might dig more into that.

Fixes #7265

Signed-off-by: Fred Carlsen <[email protected]>

---------

Signed-off-by: Fred Carlsen <[email protected]>
@DavithkbY
Copy link

Still not fixed in 3.57.0 ... @sjelfull @jordanl17

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.

Referenced document won't open in group tab.
3 participants