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

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


case 'Tab': {
if (tabToSelect) {
event.preventDefault();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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

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

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

export const tabToSelect = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants