Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Select element automatically hides. #84

Open
mihailungu20 opened this issue Aug 21, 2023 · 2 comments
Open

[BUG] - Select element automatically hides. #84

mihailungu20 opened this issue Aug 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mihailungu20
Copy link

mihailungu20 commented Aug 21, 2023

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.

@mihailungu20 mihailungu20 added the bug Something isn't working label Aug 21, 2023
@mihailungu20 mihailungu20 changed the title [BUG] - [BUG] - Select element automatically hides. Aug 21, 2023
@Rabanipour
Copy link

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.

@ThomasPerraudin
Copy link

I confirm the issue. The solution provided by @Rabanipour works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants