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

The onRightClick event was triggered on a disabled Button since Chrome 92

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Normal
    • None
    • 9.5.1.3
    • Browser Issue, Components
    • Chrome Version 92.0.4515.107 (Official Build) (x86_64)
      Edge Version 93.0.957.0 (Official build) Dev (x86_64)

    Description

      Steps to Reproduce

      <zk>
        <button disabled="true" onRightClick='alert("triggered")' label="Right-click me!"/>
      </zk>
      

      Right-click on the button.

      Current Result

      Only Chromium-based browsers trigger a right-click event.

      Expected Result

      No onRightClick event should be triggered.

      Debug Information

      Since Chrome 92.

      A reproducible HTML example:

      <div id="outer">
          <button id="btn" disabled>Right-click me!</button>
      </div>
      <script>
      document.getElementById('outer').addEventListener('contextmenu', (e) => console.log('outer received'));
      document.getElementById('btn').addEventListener('contextmenu', (e) => console.log('btn received'));
      </script>
      

      Since parents will receive the event, ZK will handle the event and send it back to the server.

      Not sure it's a bug or a feature.

      Workaround


      Attachments

        Issue Links

          Activity

            People

              DevChu DevChu
              rudyhuang rudyhuang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h