Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled buttons are clickable in Firefox #7043

Closed
mpayson opened this issue May 26, 2023 · 6 comments
Closed

Disabled buttons are clickable in Firefox #7043

mpayson opened this issue May 26, 2023 · 6 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. browser-firefox Issues tied to the last 2 versions of Firefox browser. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@mpayson
Copy link

mpayson commented May 26, 2023

Actual Behavior

Clicking a disabled button fires the onClick event

Expected Behavior

Clicking a disabled button does not fire the onClick event

Reproduction Sample

https://codepen.io/mpayson/pen/VwENeyv

Reproduction Steps

  1. Open sample & developer console
  2. Click button
  3. See logged message

Reproduction Version

1.4.0

Relevant Info

No response

Regression?

No response

Priority impact

p2 - want for current milestone

Impact

Maybe this could be lower priority, we can work around it by ignoring the click even when the button is disabled

Esri team

N/A

@mpayson mpayson added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels May 26, 2023
@github-actions github-actions bot added the impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone label May 26, 2023
@geospatialem geospatialem added the browser-firefox Issues tied to the last 2 versions of Firefox browser. label May 27, 2023
@geospatialem
Copy link
Member

geospatialem commented May 27, 2023

Was able to repro in FF (Chrome and Edge are performing as-expected). Still repro in last night's 1.4.1 release, which included #7031.

@jcfranco jcfranco self-assigned this May 30, 2023
@jcfranco jcfranco added estimate - 3 A day or two of work, likely requires updates to tests. p - high Issue should be addressed in the current milestone, impacts component or core functionality 1 - assigned Issues that are assigned to a sprint and a team member. and removed needs triage Planning workflow - pending design/dev review. 0 - new New issues that need assignment. labels May 30, 2023
@tristan-morrison
Copy link

If it matters for prioritization purposes, this impacts the Editor widget in the JS SDK.

@geospatialem geospatialem added the ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. label May 30, 2023
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels May 30, 2023
@jcfranco jcfranco changed the title Disabled buttons are clickable Disabled buttons are clickable in Firefox Jun 2, 2023
@geospatialem
Copy link
Member

There are two workarounds available, however it will prevent providing a tooltip to a disabled button:

<calcite-button style="pointer-events:none" disabled id="example-button">Open modal</calcite-button>

or checking if the button is disabled in the event listener:

button.addEventListener("click", (evt) => {
  if (evt.target.disabled) {
    return;
  } else {
   modal.open = true;
  }
});

@geospatialem geospatialem added the has workaround Issues have a workaround available in the meantime. label Jun 15, 2023
jcfranco added a commit that referenced this issue Jun 16, 2023
…ox (#7107)

**Related Issue:** #7043

## Summary

This applies a workaround for Firefox not firing capture events before
non-capture ones to block mouse events when components are disabled.

### Notable changes

* added `connectInteractive`/`disconnectInteractive` utils, solely to
support Firefox
* moved user agent utils to `browser.ts`

### Additional info

* [Firefox recently fixed
this](https://bugzilla.mozilla.org/show_bug.cgi?id=1731504) to follow
the spec and it should ship in version 116.
* https://wpt.live/dom/events/EventTarget-dispatchEvent.html is the
relevant web platform test.
*
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#useCapture
👇

> Note: For event listeners attached to the event target, the event is
in the target phase, rather than the capturing and bubbling phases.
Event listeners in the capturing phase are called before event listeners
in any non-capturing phases.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jun 16, 2023
@github-actions github-actions bot assigned geospatialem and unassigned jcfranco Jun 16, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@jcfranco
Copy link
Member

@geospatialem Here's a codepen I used to look for regressions related to #5318. Sharing in case it helps.

@geospatialem geospatialem removed the 3 - installed Issues that have been merged to master branch and are ready for final confirmation. label Jun 22, 2023
@geospatialem geospatialem added the 4 - verified Issues that have been released and confirmed resolved. label Jun 22, 2023
@geospatialem
Copy link
Member

Verified with Franco's codepen above and https://codepen.io/geospatialem/pen/rNQMPXg in 1.5.0-next.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Maps SDK for JavaScript Issues logged by ArcGIS SDK for JavaScript team members. browser-firefox Issues tied to the last 2 versions of Firefox browser. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants