material-web icon indicating copy to clipboard operation
material-web copied to clipboard

event.preventDefault() has no effect on interactive components

Open md5login opened this issue 2 years ago • 0 comments

What is affected?

Component

Description

On a native radio input, if a 'click' (or any other) event default action is being prevented by a listener, it immediately affects the input by preventing the default actions to take place.

<md-radio>'s built-in event handling is not affected by preventing default of an event. Was this code supposed to allow the user to process the event before taking actions? If so, I believe it should wait for a macrotask instead,

Furthermore, same behavior could be observed in any component's event handling, where await 0 or await null is used.

Reproduction

The described behavior can be observed here

Workaround

None

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

1.1.1

Browser/OS/Node environment

Browser: Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0 OS: Windows NT 10.0; Win64; x64

md5login avatar Feb 03 '24 18:02 md5login