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

AccessibleExample clearing selection on non-input key presses #41

Open
juanedi opened this issue Nov 4, 2016 · 1 comment
Open

AccessibleExample clearing selection on non-input key presses #41

juanedi opened this issue Nov 4, 2016 · 1 comment

Comments

@juanedi
Copy link

juanedi commented Nov 4, 2016

To reproduce in the demo page:

  • focus on input field
  • press a letter
  • select any option with the mouse
  • press shift, control, caps lock, or any key that doesn't change the input text

After doing this, the stored value in the model is reset. I believe it may be due to the following code:

        onKeyDown =
            \code maybeId ->
                if code == 38 || code == 40 then
                    Maybe.map PreviewPerson maybeId
                else if code == 13 then
                    Maybe.map SelectPersonKeyboard maybeId
                else
                    Just <| Reset

It can be verified by modifying demo app so that it displays or logs the selected option.

I know this is just a demo, but since it is being suggested as the mostly drop-in solution I believe it should probably be fixed. Spending some time integrating and tuning the example to later find this out is kinda sad.

Great work BTW :)

@gregziegan
Copy link
Owner

Thanks for reporting! I'll be fixing this with the elm 0.18 release 😄 . Going to write some actual tests to verify the autocomplete works according to ARIA specs as well 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants