Skip to content

feat: formAssociated element should treat boolean "disabled" Prop differently #5461

@danyball

Description

@danyball

Prerequisites

Describe the Feature Request

If the component has set formAssociated: true and a boolean disabled Prop the component should not add this as a attribute if disabled=false is set.

Describe the Use Case

We have formAssociated elements which should emit the click event if the user clicks on it. This should also work if disabled=false is set.
For formAssociated elements the value of disabled is not respected like described here: https://html.spec.whatwg.org/dev/form-control-infrastructure.html#attr-fe-disabled:~:text=custom%20element%2C-,and%20the,attribute%20is%20specified%20on%20this%20element%20(regardless%20of%20its%20value),-%3B%20or

Describe Preferred Solution

If formAssociated: true and disabled=false is set, the attribute should not be present.

Describe Alternatives

No response

Related Code

Reproducer: https://github.com/danyball/stencil-noevent.git

Additional Information

Closed Mozilla bug ticket (not sure if related): https://bugzilla.mozilla.org/show_bug.cgi?id=1818287

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions