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

onRightClick on <html> doesn't stop context menu

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 9.0.1.2, 9.1.0, 8.5.0.1
    • Fix Version/s: 9.5.1
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 9.5.1 S1

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: