browser icon indicating copy to clipboard operation
browser copied to clipboard

Currently no way of using preventDefault on window events

Open wolfadex opened this issue 5 years ago • 3 comments

I could really use it right now for limited keyboard accessibility, where the user doesn't have access to the Tab key or to a mouse. Their only means of navigation are the arrow keys. I can do Html.Events.preventDefaultOn on the outermost div but there's still a possibility of that not working if focus gets changed to the body.

There are some who have commented in Slack that this would also be beneficial for game development.

wolfadex avatar Apr 19 '19 21:04 wolfadex

Also, there is no way to listen to scroll event on the body.

Ports helped make it work, but still, some that would be nice in 0.21 :)

popara avatar May 28 '19 11:05 popara

I am trying to override the default "Cmd + S" behavior in browsers. So I need to prevent default on the S keydown event when metaKey is true. But not otherwise.

Chadtech avatar Jun 09 '20 14:06 Chadtech

I faced the same issue today but found a workaround that works: https://github.com/elm/browser/issues/89#issuecomment-904493814

atlewee avatar Aug 24 '21 09:08 atlewee