Commit cbff1ee5 authored by Christopher Lam's avatar Christopher Lam Committed by Commit Bot

[MD Bookmarks] Clear internal drag when native drag starts.

Bug: 748445
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I5d10fdd84b302a3064056f73544d8c214aace2bd
Reviewed-on: https://chromium-review.googlesource.com/584558Reviewed-by: default avatarTim Sergeant <tsergeant@chromium.org>
Commit-Queue: calamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491167}
parent 23aed633
......@@ -635,7 +635,6 @@ cr.define('bookmarks', function() {
*/
startNativeDrag_: function() {
var state = bookmarks.Store.getInstance().data;
this.dndChip.hide();
if (!this.dragInfo_.isDragValid())
return false;
......@@ -643,6 +642,10 @@ cr.define('bookmarks', function() {
var draggedNodes =
this.dragInfo_.dragData.elements.map((item) => item.id);
// Clear the drag data here so that the chip is hidden. The native drag
// will return after the clearing and set up its data.
this.clearDragData_();
// TODO(calamity): account for touch.
chrome.bookmarkManagerPrivate.startDrag(draggedNodes, false);
......
......@@ -383,6 +383,7 @@ suite('drag and drop', function() {
assertDeepEquals(['13'], getDragIds());
dispatchDragEvent('dragstart', dragElement);
assertEquals(null, dndManager.internalDragElement_);
assertDeepEquals(['13'], draggedIds);
dndManager.handleChromeDragEnter_(createDragData(draggedIds));
......
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