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

Set highlightedIndex to defaultHighlightedIndex on input value change #675

Merged
merged 1 commit into from
Mar 9, 2019

Conversation

kilrain
Copy link
Contributor

@kilrain kilrain commented Feb 20, 2019

What:

This PR ensures the highlightedIndex is reset to defaultHighlightedIndex when the inputValue is changed.

Why:

documented here: #664

How:

In both inputHandleChange and inputHandleTextChange, I included the following bit of state to update:

{
  highlightedIndex: this.props.defaultHighlightedIndex,
}

I've also added a test and updated the docs to reflect this change.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Additionally,

  • I ran into an error when running the setup script which is documented in the feature request ticket
  • I added .vscode to .gitignore

@silviuaavram
Copy link
Collaborator

I've added some changes related to these highlighted indexes. Make sure to rebase and see that it works.

I will try to help you as much as possible to get these changes in, as it will be a great improvement for our accessibility. Thanks again for contributing!

@kilrain
Copy link
Contributor Author

kilrain commented Feb 26, 2019

Got it... I'll pull down the changes and confirm we're good to go.

@kilrain kilrain marked this pull request as ready for review February 27, 2019 00:33
@kilrain
Copy link
Contributor Author

kilrain commented Feb 27, 2019

@silviuavram My smoke testing worked as expected and all unit tests pass as well.

Copy link
Collaborator

@silviuaavram silviuaavram left a comment

Choose a reason for hiding this comment

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

see the comments and after addressing them we are good to go. Thank you again for the changes, we really needed them!

src/__tests__/downshift.get-input-props.js Outdated Show resolved Hide resolved
src/__tests__/downshift.get-input-props.js Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@kilrain kilrain force-pushed the highlightedIndex branch from 352e490 to 61035a1 Compare March 4, 2019 18:47
@kilrain kilrain force-pushed the highlightedIndex branch from 61035a1 to c4ac3a5 Compare March 4, 2019 18:51
@kilrain
Copy link
Contributor Author

kilrain commented Mar 4, 2019

Ok - change requests resolved.

@silviuaavram silviuaavram merged commit 5b721a1 into downshift-js:master Mar 9, 2019
@silviuaavram
Copy link
Collaborator

🎉 This PR is included in version 3.2.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kilrain kilrain deleted the highlightedIndex branch March 13, 2019 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants