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(form): prevent drop event propagating outside of EditPortal component #5813

Merged
merged 6 commits into from
Feb 29, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Feb 21, 2024

Description

When the EditPortal dialog is open for an object in an array, the array input itself still responds to drop events. This means it's possible to drop a file on the array while it's behind a modal dialog and appears to be inert.

It's particularly problematic if a user attempts to drop a file into the dialog itself, but slightly misses the drop zone, causing the file to be dropped onto the array.

What to review

  • The change and the test are correct.
  • You can take a look in Studio by creating an object in an array (e.g. in test-studio: test/structure/input standard;arraysTest;0154c37b-c15a-41bc-9779-54a6c1db4889).
  • While the EditPortal dialog is open, attempt to drop a file onto the dialog or its backdrop. The file should not be added to the list input.

Testing

E2E test included.

pnpm run test:e2e test/e2e/tests/inputs/array.spec.ts

Notes for release

Fixes an issue that allowed files to be dropped behind the open modal (where the inputs appeared to be inert).

Copy link

vercel bot commented Feb 21, 2024

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

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Feb 29, 2024 11:17am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 29, 2024 11:17am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 11:17am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 21, 2024

Component Testing Report Updated Feb 29, 2024 11:28 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 59s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 0s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 23s 8 0 1

@juice49 juice49 force-pushed the fix/sdx-502-edit-portal-drop-zone-leak branch from fc51c03 to 838d348 Compare February 27, 2024 16:07
@juice49 juice49 marked this pull request as ready for review February 27, 2024 16:07
@juice49 juice49 requested a review from a team February 27, 2024 16:07
@juice49 juice49 requested a review from a team as a code owner February 27, 2024 16:07
@juice49 juice49 requested review from hermanwikner, bjoerge and a team and removed request for a team February 27, 2024 16:07
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.

This is great, thank you for adding tests too! <3

@juice49 juice49 added this pull request to the merge queue Feb 29, 2024
Merged via the queue into next with commit fc73437 Feb 29, 2024
39 of 40 checks passed
@juice49 juice49 deleted the fix/sdx-502-edit-portal-drop-zone-leak branch February 29, 2024 11:32
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.

2 participants