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

Tab to select #164

Closed
wants to merge 8 commits into from
Closed

Tab to select #164

wants to merge 8 commits into from

Conversation

@rickhanlonii
Copy link
Contributor

@rickhanlonii rickhanlonii commented May 5, 2016

Overview

Adds a setting tabToSelect to allow tabbing to select suggestion.

Closes #163

Details

  • Adds property tabToSelect (defaults to false)
  • Sends Tab event type to onSuggestionsUpdateRequested and onSuggestionSelected
  • Updates README documentation with setting and event types for above functions
  • Adds tests for both true and false values of the setting
@rickhanlonii rickhanlonii force-pushed the rickhanlonii:tab-as-select branch from 4c9cea5 to 67ac04f May 5, 2016

case 'Tab': {
if (tabToSelect) {
event.preventDefault();

This comment has been minimized.

@rickhanlonii

rickhanlonii May 6, 2016
Author Contributor

This may need to be moved inside the if below. Users may want to tab to another field when there's no focused suggestion.

@moroshko
Copy link
Owner

@moroshko moroshko commented May 7, 2016

@rickhanlonii Thanks a lot for a detailed PR!

I must admit that I'm a bit confused with the functionality you are trying to achieve. In #163 you mentioned "Slack user mentions". As far as I can see, pressing Tab in Slack is somewhat equivalent to pressing Down, not pressing Enter, i.e. it moves to the next suggestion rather than selecting the focused one. The URL bar in Chrome behaves the same. Am I missing something?

@rickhanlonii
Copy link
Contributor Author

@rickhanlonii rickhanlonii commented May 8, 2016

Great point @moroshko, I'll update and re-open.

@@ -54,6 +54,18 @@ export const onSuggestionsUpdateRequested = sinon.spy(({ value }) => {
});
});

export const tabToSelect = {

This comment has been minimized.

@rickhanlonii

rickhanlonii May 8, 2016
Author Contributor

Note: also going to update this API per the comments here.

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

Successfully merging this pull request may close these issues.

None yet

2 participants