browser
browser copied to clipboard
Currently no way of using preventDefault on window events
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.
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 :)
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.
I faced the same issue today but found a workaround that works: https://github.com/elm/browser/issues/89#issuecomment-904493814