Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Click events are fired on disabled button with element like i tag. #73

Closed
ledsun opened this issue Aug 4, 2015 · 3 comments
Closed

Comments

@ledsun
Copy link

ledsun commented Aug 4, 2015

I expect no click event is fired from a disabled button.
But click events are fired when the button has a member element like i tag.

Sample

https://jsfiddle.net/63f4qpp8/1/

Why need

I want use button with font-awesome icons.

For examle:

<button><i class="fa fa-500px"></i></button>
orangemug added a commit to orangemug/dom-delegate that referenced this issue Sep 29, 2016
@orangemug
Copy link
Contributor

I believe I have a fix for this in master...orangemug:fix/issue-73-disabled-events however it needs a little more work to improve the performance

@orangemug
Copy link
Contributor

I believe branch master...orangemug:fix/issue-73-disabled-events is now ready and fixes point 1 in the below spec extract

A form control is disabled if any of the following conditions are met:

  1. The element is a button, input, select, or textarea element, and the disabled attribute is specified on this element (regardless of its value).
  2. The element is a descendant of a fieldset element whose disabled attribute is specified, and is not a descendant of that fieldset element's first legend element child, if any.

See https://html.spec.whatwg.org/multipage/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute

Once the blocking PR #81 is merged I'll raise a PR for this ticket.

@notlee
Copy link
Contributor

notlee commented Sep 18, 2019

Hi all, this is fixed by orangemug's pr which will go out in the next release (v3.1.0). Thanks for creating the issue and waiting so long!

@notlee notlee closed this as completed Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants