Skip to content

bug: manually dispatching click on disabled toggle, radio, and checkbox still activates elements #28293

Description

@liamdebeasi

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Disabled form controls can still be activated by manually dispatching click events. This is happening because we only set pointer-events: none:

This prevents users from clicking on the element, but it does not block manual click dispatches via JS.

Expected Behavior

Disabled form controls should never activate even when a click is manually dispatched.

Steps to Reproduce

  1. Open code reproduction.
  2. Click "Dispatch Click".
  3. Observe that the listed form controls are activated even though they are disabled.

Code Reproduction URL

https://codepen.io/liamdebeasi/pen/yLGQMMG

Ionic Info

N/A

Additional Information

Originally reported on Discord: https://discord.com/channels/520266681499779082/520358571720966154/1159605276203302992

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions