-
Bug
-
Resolution: Fixed
-
Normal
-
8.0.2, 8.6.0.1
-
Security Level: Jimmy
-
FF (63, tested on Windows 10)
-
None
Steps to Reproduce
run the attachment dnd-FF-overflow.zul
drag the labels from both red and green div and drop on the blue target area
Current Result
in FF the drop doesn't trigger when dragged from the div with overflow auto...
also the .z-drag-over style class is not added to the drop target while dragging over
Expected Result
working DnD
Debug Info
this still worked in 8.0.1.1 and fails since 8.0.2
Root Cause
same reason as ZK-3518 just all other overflow types besides 'visible' have the problem on FF
https://github.com/zkoss/zk/blob/v8.6.0.1/zk/src/archive/web/js/zk/widget.js#L283
condition should be !== 'visible'
Workaround
zk.afterLoad('zk', function() { function isFFOverflowBug(evt) { // Firefox's bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1259357 return zk.ff && jq(evt.domTarget).css('overflow') !== 'visible'; } function isIEImageTagBug(evt) { // IE 9~11 and Edge may receive a wrong target when dragging with an Image. return (zk.ie > 8 || zk.edge) && jq.nodeName(evt.domTarget, 'img'); } zk.DnD.getDropTarget = function (evt, drag) { var wgt; if (isFFOverflowBug(evt) || isIEImageTagBug(evt)) { var n = document.elementFromPoint(evt.domEvent.clientX, evt.domEvent.clientY); if (n) wgt = zk.$(n); } else { wgt = evt.target; } return wgt; } });//zk.afterLoad
- relates to
-
ZK-3518 Drag Groupbox's content doesn't give "droppable" effect in Firefox
- Closed