Pressing spacebar scrolls page down?

后端 未结 3 446
悲哀的现实
悲哀的现实 2020-11-30 10:56

I have a problem that I\'m not even sure what to search for in order to fix. When I press the spacebar my entire page moves up (scrolls down): I don\'t want this to happen.

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 11:40

    It's not enough to just hide the overflow; you actually have to make it not overflow. Even if you could disable the behavior (eating the keystroke, putting focus inside some other container), the user might still be able to scroll via the keyboard, by drag-selecting text on the page, holding down the middle mouse button, etc... It's really up to their browser, and so long as the content is still technically visible, they'll probably have some way to scroll it into view.

    Time to re-think your layout.

提交回复
热议问题