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

touch event handling interferes with user defined jQuery version

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.7, 7.0.3
    • 6.5.4, 6.5.6, 7.0.2
    • Components
    • Security Level: Jimmy
    • None

      run the 2 attachments on an iphone (or emulated iphone in chrome dev tools)
      error-test-no-jquery.zul -> works when scrolling the page content by swiping

      error-test-jquery.zul -> causes JS errors when the content is scrolled via swipe

      Uncaught TypeError: undefined is not a function zk.wpd:22722
      (anonymous function) zk.wpd:22722
      _doEvt zk.wpd:25256
      delegateEventFunc zk.wpd:25266
      jQuery.event.handle zk.wpd:3015
      elemData.handle.eventHandle zk.wpd:2649
      

      the error is caused in web.js.zk/domtouch.js when a touchevent is transformed into a mouse event using the wrong jq object

      function _createJQEvent (target, type, button, changedTouch, ofs) {
      	//do not allow text
      	//ZK-1011
      	if (target && (target.nodeType === 3 || target.nodeType === 8))
      		target = target.parentNode;
      	
      	var originalEvent = _createMouseEvent(type, button, changedTouch, ofs),
      		props = jQuery.event.props,
      		event = jQuery.Event(originalEvent);
      

      the last two lines use the default "jQuery" object and not the zk internal "jq"

      replacing those lines with the following fixed the issue:

      		props = jq.event.props,
      		event = jq.Event(originalEvent);
      

            hanhsu hanhsu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: