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

Canceling Drag and Drop with ESC immediately hides dropzone bar (#24204) #25317

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

mreishus
Copy link
Contributor

Description

fixes #24204

When canceling a drag and drop operation by pressing "ESC", the blue dropzone bar will now immediately disappear.

Previously, it would only disappear after the next "Mouse Up" event. If you pressed ESC, kept the mouse button held, moved the mouse outside the browser then released the button, the blue bar would be showing indefinitely.

How has this been tested?

Tested manually by running wp-env start and npm run dev.

Screenshots

Before fix:
2020-09-14_15-09

After fix:
2020-09-14_15-11

Types of changes

  • Bug fix: The isDraggingBlocks() selector is now also checked when deciding to render the is-drop-target class. Previously, only the dropTargetIndex was being checked.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@youknowriad youknowriad requested a review from talldan September 15, 2020 07:44
@talldan talldan added [Feature] Drag and Drop Drag and drop functionality when working with blocks First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Sep 16, 2020
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this issue @mreishus and congrats on your first contribution 🎉

@talldan talldan merged commit 222711f into WordPress:master Sep 16, 2020
@github-actions
Copy link

Congratulations on your first merged pull request, @mreishus! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 9.1 milestone Sep 16, 2020
@mreishus mreishus deleted the fix/drag-and-drop-esc-cancel branch September 16, 2020 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Drag and Drop Drag and drop functionality when working with blocks First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drag and drop: hitting ESC while in drag and drop cancels the operation, but dropzone bar stays visible
2 participants