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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 9.5.1.3
    • Fix Version/s: None
    • Component/s: Browser Issue, Components
    • Environment:

      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

              Assignee:
              katherinelin katherinelin
              Reporter:
              rudyhuang rudyhuang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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