Choices-js / Choices

A vanilla JS customisable select box/text input plugin ⚡️
https://choices-js.github.io/Choices/
MIT License
6.17k stars 607 forks source link

The page scrolls when you press 'space' on a single select input #1103

Closed ollietreend closed 1 month ago

ollietreend commented 1 year ago

Describe the bug

When a single select input is focussed and the 'space' bar is pressed, the page scrolls down.

To Reproduce Steps to reproduce the behavior:

  1. Go to the 'Single select input' section of the Choices.js demo
  2. Use Tab key to navigate to & focus a single select input
  3. Press Space key
  4. The selected input scrolls out of view

Expected behavior The single select input should have opened, without the viewport scrolling and without a Space character being entered into the input's search box. This is standard behaviour for select inputs when navigating with a keyboard.

Screenshots

https://user-images.githubusercontent.com/7735945/216588751-e2d21a31-9bbe-4a85-997c-f789e7b0dffd.mov

Desktop (please complete the following information):

joffreypersia commented 1 year ago

Up !

Xon commented 1 month ago

Implemented as part of https://github.com/Choices-js/Choices/pull/1166