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

Dropdown: selectOnKeydown option from docs is not implemented #1993

Closed
rijk opened this issue Aug 22, 2017 · 2 comments
Closed

Dropdown: selectOnKeydown option from docs is not implemented #1993

rijk opened this issue Aug 22, 2017 · 2 comments

Comments

@rijk
Copy link
Member

rijk commented Aug 22, 2017

Steps

Used the selectOnKeydown={false} option as mentioned in the docs:

Whether dropdown should select new option when using keyboard shortcuts. Setting to false will require enter or left click to confirm a choice.

Expected Result

Keyboard navigation moving selection, without actually changing value.

Actual Result

Value changes and dropdown closes when pressing e.g. arrow down key. + React warning:

Warning: Unknown prop `selectOnKeydown` on <div> tag. Remove this prop from the element.

Version

0.71.5

I think the problem is here: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/modules/Dropdown/Dropdown.js#L543

This line should be IMO something like this:

if (!multiple && selectOnKeydown) this.makeSelectedItemActive(e)

@rijk
Copy link
Member Author

rijk commented Aug 22, 2017

Ah doh, this is the Semantic docs, not the Semantic React. Even so, it would be nice to see this option implemented. Having the value selected right away when pressing down arrow just feels really unintuitive.

@layershifter layershifter changed the title [Dropdown] selectOnKeydown option from docs is not implemented Dropdown: selectOnKeydown option from docs is not implemented Aug 23, 2017
levithomason pushed a commit that referenced this issue Sep 23, 2017
* feat(Dropdown): implement `selectOnNavigation` prop (#1993)

* feat(Dropdown): add tests, types and doc example

* fix(Dropdown): fix lint issues

* fix(Dropdown): handle items with value 0

* docs(Dropdown): fix/update selectOnKeyDown example

* refactor(Dropdown): selectOnKeydown to selectOnNavigation

* test(Dropdown): add selectOnNavigation value assertions

* fix(Dropdown): run lint fix
@layershifter
Copy link
Member

Done in #2009 as selectOnNavigation.

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

No branches or pull requests

2 participants