furcan/KioskBoard

[BUG] - Select element automatically hides.

Opened this issue · 1 comments

Describe the bug

Select element automatically hides after the [Enter] key from Kioskboard is pressed. It works correctly if the Kioskboard is closed by pressing outside it.

To Reproduce

Sandbox here: https://codesandbox.io/s/winter-fast-zyhmwz

Steps to reproduce the behavior:

  1. Have an input which uses Kioskboard.
  2. Open given input, use Kioskboard to type something
  3. Press [Enter]
  4. The Kioskboard closes
  5. Click on select
  6. It automatically hides

Expected behavior

Select element should remain open until an option is selected.

Screenshots

Desktop (please complete the following information):

  • OS: Win 10
  • Browser: Chrome, Edge
  • Version Chrome - 116.0, Edge - 115.0

Additional context

Setting no css animation makes the select option hide more rapidly.

You just need to remove the event listener after the ‘Enter’ is clicked.
So in Kioskboard-2.3.0.min.js.
Change:
var k = a.document.querySelector(".kioskboard-key-enter");
k && va(k, function () {
!0 === A.keysEnterCanClose && ta(), "function" == typeof A.keysEnterCallback && A.keysEnterCallback();
})

To:
var k = a.document.querySelector(".kioskboard-key-enter");
k && va(k, function () {
!0 === A.keysEnterCanClose && ta(), "function" == typeof A.keysEnterCallback && A.keysEnterCallback();
a.document.removeEventListener("click", Xa);
})
There maybe a better way, but that is how I have fixed mine.