[Bug] default actions are not prevented by halt/exit

This issue has been tracked since 2022-07-28.

I wrote a live example in order to verify the behaviour of halt and exit (as the docs seem to be wrong, presumably, because of cut-and-paste actions)

The outcome: event defaults seem never to be prevented (try checkboxes #2, #4, #5, #7 and #8)

1cg wrote this answer on 2022-10-05

It turns out that this is correct behavior: preventDefault() doesn't prevent checking the checkbox in the input event. Rather, you have to do it in the click event. You can verify this by using inline handlers w/ vanilla javascript:

	<input type="checkbox" _="on input halt"/>
	<input type="checkbox" oninput="event.preventDefault()"/>

	<input type="checkbox" _="on click halt"/>
	<input type="checkbox" onclick="event.preventDefault()"/>

The halt command does invoke preventDefault() (depending on the exact syntax you use), as you can see here:

https://github.com/bigskysoftware/_hyperscript/blob/master/src/_hyperscript.js#L4989

More Details About Repo
Owner Name bigskysoftware
Repo Name _hyperscript
Full Name bigskysoftware/_hyperscript
Language JavaScript
Created Date 2020-05-27
Updated Date 2022-11-25
Star Count 1265
Watcher Count 18
Fork Count 75
Issue Count 86

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date