-
Bug
-
Resolution: Fixed
-
Major
-
9.6.3
-
None
-
Security Level: Jimmy
-
None
Steps to Reproduce
Run fiddle
https://zkfiddle.org/sample/1r2e975/2-missing-context-menu-after-ZK-4835
Run on chrome, on a device with both mouse and touch screen.
Alternatively, use chrome dev. tools sensor panel to force touch API enabling.
Long press on one of the labels
Current Result
Context popup doesn't open.
Expected Result
context popup opens at mouse position
Debug Information
In zk.Widget.prototype.bind_, the touch workflows (bindSwipe, bindDoubleTap, bindTapHold) are only triggered if zk.mobile is true.
zk.mobile is only true on tablet / cellphone, not on laptop with touch screen.
Updated Workaround
updated: use different entrypoint
<script><![CDATA[ zk.afterLoad("zk", function () { var _xWidget = {}; zk.override(zk.Widget.prototype, _xWidget, { bind_: function bind_(desktop, skipper, after) { _xWidget.bind_.apply(this, arguments); if (zk.touchEnabled && !zk.mobile) { var self = this; after.push(function () { setTimeout(function () { self.bindSwipe_(); self.bindDoubleTap_(); self.bindTapHold_(); }, 300); }); } }, _tapHoldStart: function _tapHoldStart(evt) { _xWidget._tapHoldStart.apply(this, arguments); if(evt.touches.length){ zk.currentPointer = [evt.touches[0].clientX,evt.touches[0].clientY]; } } }); }); ]]></script>
- relates to
-
ZK-4835 Browsers supporting both touch and mouse fails to register mouse events following ZK-4301
- Closed