Commit 5e11d0f5 authored by John Lee's avatar John Lee Committed by Commit Bot

WebUI Tab Strip: Don't update drag session on dragenter events

Previously, the drag session would be updated as soon as a dragenter
event was fired. This was to allow a dragged out tab to instantly
re-appear in the tab strip once it was dragged back in. Unfortunately,
there exists a bug that causes the drag event's target to be incorrect
if the scale is not 100%.

Removing the update on dragenter should not cause any issues because
the drag session will get updated on the very next dragover event.

Bug: 1117190
Change-Id: Ia06007ab4c3c4827b2783be9cef4df1c30d00f8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357599Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799219}
parent a4eafb00
......@@ -512,7 +512,9 @@ export class DragManager {
/** @param {!DragEvent} event */
onDragEnter_(event) {
if (this.dragSession_) {
this.dragSession_.update(event);
// TODO(crbug.com/843556): Do not update the drag session on dragenter.
// An incorrect event target on dragenter causes tabs to move around
// erroneously.
return;
}
......
......@@ -638,7 +638,7 @@ suite('DragManager', () => {
delegate.dispatchEvent(new DragEvent('dragleave', {dataTransfer}));
assertTrue(isDraggedOut);
delegate.dispatchEvent(new DragEvent('dragenter', {dataTransfer}));
delegate.dispatchEvent(new DragEvent('dragover', {dataTransfer}));
assertFalse(isDraggedOut);
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment