Closed NickColley closed 7 years ago
I thought I remembered something about keydown
being a bit weird in old IE, but I think I was actually thinking about keypress
. I guess this has been tested in IE8+? If so I’ll merge.
Okay after testing this again I realise keyup is the right behaviour for space.
So this PR needs to be changed to handle keydown
to prevent scrolling of the page, and handle keyup
to click the button...
I can't find a place where that behaviour is defined in any spec, so I'm presuming it's down to the operating system.
I've tested this PR in IE8,IE9,IE10 and it works.
So this should be good to go as long as we can stomach the spacebar submitting on keydown and not keyup.
When trying to implement the shim I found the page will scroll when pressing space, then you navigate to the page.
To fix this we need to instead listen for
keydown
and notkeyup
so we can prevent the unwanted scroll behaviour.I've also added a commit to simplify the shim since there's not a clear need for this to be flexible.