Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1011

drag and drop in mobile safari throwing exceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.1, 5.0.12
    • 6.0.0, 5.0.11
    • ZK Client Engine
    • None

      Reproduce step :

      1.drag the item out of the browser body.

      ------

      It's cuasing by emulating the mouse event from touch event,
      it's not firing mouse event after we drage out of the body in mouse event.

      in domiso.js ,

      function _createJQEvent (target, type, button, changedTouch, ofs) {
      	//do not allow text
      	try{
      	if (target.nodeType === 3 || target.nodeType === 8)
      		target = target.parentNode;
      

      When we try to emulate mouse event , the "document.elementFromPoint()" return a null

      function _toMouseEvent(event, changedTouch) {
      	switch (event.type) {
      	case 'touchstart':
      		return _createJQEvent(changedTouch.target, 'mousedown', 0, changedTouch);
      	case 'touchend':
      		return _createJQEvent(
      			document.elementFromPoint(
      				changedTouch.clientX, 
      				changedTouch.clientY), 
      				'mouseup', 0, changedTouch);
      		break;
      	case 'touchmove':
      		return _createJQEvent(
      			document.elementFromPoint(
      				changedTouch.clientX, 
      				changedTouch.clientY),
      			'mousemove', 0, changedTouch);
      		break;
      	}
      	return event;
      }
      

      Possible solution:

      1. Refine the code in createJQEvent to check if target is null instead of calling undefined object.

      2. not firing mousemove when the target is null ( more reasonable for me. )

            TonyQ TonyQ
            TonyQ TonyQ
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: