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
HTML5Backend Event Swallowing Updates #3052
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3052 +/- ##
==========================================
+ Coverage 45.19% 45.24% +0.05%
==========================================
Files 248 248
Lines 3790 3799 +9
Branches 770 773 +3
==========================================
+ Hits 1713 1719 +6
- Misses 2076 2079 +3
Partials 1 1
|
@darthtrevino I'm not familiar with the react-dnd architecture yet, but is it not possible to restrict all of it's event capturing to within the boundaries of a dom element, perhaps by passing a I'd hate to see all of the IE support you've built over the years have to suffer… |
@@ -632,6 +610,9 @@ export class HTML5BackendImpl implements Backend { | |||
|
|||
public handleTopDragLeaveCapture = (e: DragEvent): void => { | |||
if (this.isDraggingNativeItem()) { | |||
if (!this.options.unblockNativeTypeEvents) { | |||
!this.options.unblockNativeTypeEvents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unexpected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you
@tommoor That's not a terrible idea. I've added a |
I wish I could test but for some reason |
@tommoor I published this branch as |
Good news – it seems to work well passing the |
Something in |
Yep, let’s cut a new issue for this. Are you using react-dnd 13? (The
backend is 12.x still). I was running into some goofy bugs with the hooks
API that I could only resolve by doing some memoization with the hook
specs.
On Mon, Feb 22, 2021 at 7:55 PM Tom Moor ***@***.***> wrote:
Something in 12.1.0 regressed the hover interaction, I'm not sure if it
was this but I'm now seeing green "plus" symbol when moving items in Chrome
that wasn't there before. I can file a new issue if you'd like
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3052 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3XCAI4RGSHL63YFFKU4LTAMRKHANCNFSM4X7UXLTQ>
.
--
Sent from Gmail Mobile
|
scratch this, I just realized the API changed. |
…1918) * fix: Drag and drop images in editor, conflict with sidebar react-dnd see: react-dnd/react-dnd#3052 * Bump to non-canary * Upgrade react-dnd * react-dnd api changes * lint * fix: dnd doesn't work on first render * remove unneccessary async * chore: Update react-dnd (API changed again) * restore fade
* refactor: remove preventDefaulth in handleTopDragEnter * refactor: remove preventDefault from handleSelectStart * feat: add HTML5Backend options to unblock drag * chore: cut semver doc * fix: typo * feat: add rootElement option for attaching event listeners to * fix: revent some cuts * fix: revert some more cuts * fix: revert more cuts * feat: use localized eventing option in DnDProvider on docsite * fix: revert unblockNativeTypeEvents config options experiment * fix: guard endDrag() invocations with isDragging() * fix: error in dropTarget accept arrays * chore: update semver impact * chore: update semver
This PR removes some events swallowing that was occurring in the HTML5Backend. Some of this may cause regressions in older browsers or edge case situtaions. The goal here is to minimize our interference with natural event patterns.
There are a few instances of
preventDefault()
that were either unavoidable or needed to be selectively disabled depending on the needs of clients. In the latter case we provide a configuration option in the HTML5Backend forunblockNativeTypeEvents
@tommoor related to #2852
Usage:
Fixes #3051