You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
After having dragged an image that is inside a table, you can not drag that same image a second time. The second time you try to drag the image, dragging it is 'forbidden'.
Expected behavior
You should be able to drag an image in a table as many times you want.
Actual behavior
You can drag it only once, second time dragging is forbidden.
Steps to reproduce the problem
You can reproduce the issue using this Fiddle link: Image in table.
Drag the Froala image to another cell in the table
Try dragging that same image again to another cell
Also note that as a result of the first drag, two cells of the table have been selected; the ‘from’ and ‘to’ cell. And when you move the mouse over other cells, they are automatically selected.
Analysis
The problem seems to be in the Froala table plugin. It assumes that a mouseup event is triggered after releasing the mouse button after dragging, but this is not true. If you click on an image, drag it and release, the mouseup event is not being triggered. The Froala table plugin keeps track of the mouse button being holded in order to select table cells, in the mouseDownCellFlag variable. After dropping the element, this flag still is true. Hence after moving the mouse afterwards, the _mouseEnter function thinks the mouse button is still down and so it will trigger the selectCells function, which in its turn disables the “editing in table” mode (editor.edit.off();). Hence editor.edit.isDisabled() will return true afterwards, which (besides other side-effects) ensures elements can no longer be dragged.
The text was updated successfully, but these errors were encountered:
Summary
After having dragged an image that is inside a table, you can not drag that same image a second time. The second time you try to drag the image, dragging it is 'forbidden'.
Expected behavior
You should be able to drag an image in a table as many times you want.
Actual behavior
You can drag it only once, second time dragging is forbidden.
Steps to reproduce the problem
You can reproduce the issue using this Fiddle link: Image in table.
Also note that as a result of the first drag, two cells of the table have been selected; the ‘from’ and ‘to’ cell. And when you move the mouse over other cells, they are automatically selected.
Analysis
The problem seems to be in the Froala table plugin. It assumes that a
mouseup
event is triggered after releasing the mouse button after dragging, but this is not true. If you click on an image, drag it and release, themouseup
event is not being triggered. The Froala table plugin keeps track of the mouse button being holded in order to select table cells, in themouseDownCellFlag
variable. After dropping the element, this flag still is true. Hence after moving the mouse afterwards, the_mouseEnter
function thinks the mouse button is still down and so it will trigger theselectCells
function, which in its turn disables the “editing in table” mode (editor.edit.off();
). Henceeditor.edit.isDisabled()
will return true afterwards, which (besides other side-effects) ensures elements can no longer be dragged.The text was updated successfully, but these errors were encountered: