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

onRightClick on <html> doesn't stop context menu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.5.1
    • 9.0.1.2, 9.1.0, 8.5.0.1
    • Security Level: Jimmy
    • None
    • ZK 9.5.1 S1

      Steps to Reproduce

      https://zkfiddle.org/sample/16kgl1e/3-Html-and-right-click-event

      right click the <html> component

      Current Result

      since 8.5.0 the browser's context menu is no longer prevented
      when clicking the zk label, it is prevented

      Expected Result

      when a onRightClick listener fires, prevent the default browser event

      Debug Information

      this still works consistently in 8.0.5

      Workaround

      prevent the DOM event manually

      <zk xmlns:w="client">
        <!-- workaround: ensure the domEvent is prevented -->
        <div w:onRightClick="event.domEvent.preventDefault()" 
             onRightClick="Messagebox.show(event.getName());" >
          <label value="right click prevents browser context menu - OK" />
          <separator/>
          <html content="right click triggers browser context menu - inconsistent since ZK 8.5.0" />
        </div>
      </zk>
      

      https://zkfiddle.org/sample/16kgl1e/4-Html-and-right-click-event

            DevChu DevChu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: