downshift 5.4.6 → 5.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1421,6 +1421,7 @@ Thanks goes to these people ([emoji key][emojis]):
1421
1421
  <td align="center"><a href="https://github.com/mattleonowicz"><img src="https://avatars3.githubusercontent.com/u/9438872?v=4" width="100px;" alt=""/><br /><sub><b>Mateusz Leonowicz</b></sub></a><br /><a href="https://github.com/downshift-js/downshift/commits?author=mattleonowicz" title="Code">💻</a></td>
1422
1422
  <td align="center"><a href="https://github.com/atomicpages"><img src="https://avatars2.githubusercontent.com/u/1824291?v=4" width="100px;" alt=""/><br /><sub><b>Dennis Thompson</b></sub></a><br /><a href="https://github.com/downshift-js/downshift/commits?author=atomicpages" title="Tests">⚠️</a></td>
1423
1423
  <td align="center"><a href="https://mayicodefuture.live"><img src="https://avatars1.githubusercontent.com/u/32408893?v=4" width="100px;" alt=""/><br /><sub><b>Maksym Boytsov</b></sub></a><br /><a href="https://github.com/downshift-js/downshift/commits?author=mayicodefuture" title="Code">💻</a></td>
1424
+ <td align="center"><a href="http://dataart.com"><img src="https://avatars1.githubusercontent.com/u/5685800?v=4" width="100px;" alt=""/><br /><sub><b>Sergey Skrynnikov</b></sub></a><br /><a href="https://github.com/downshift-js/downshift/commits?author=IwalkAlone" title="Code">💻</a> <a href="https://github.com/downshift-js/downshift/commits?author=IwalkAlone" title="Tests">⚠️</a></td>
1424
1425
  </tr>
1425
1426
  </table>
1426
1427
 
@@ -1923,7 +1923,7 @@ function getInitialState(props) {
1923
1923
  var highlightedIndex = getInitialValue(props, 'highlightedIndex');
1924
1924
  var inputValue = getInitialValue(props, 'inputValue');
1925
1925
  return {
1926
- highlightedIndex: highlightedIndex < 0 && selectedItem ? props.items.indexOf(selectedItem) : highlightedIndex,
1926
+ highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,
1927
1927
  isOpen: isOpen,
1928
1928
  selectedItem: selectedItem,
1929
1929
  inputValue: inputValue
@@ -1917,7 +1917,7 @@ function getInitialState(props) {
1917
1917
  var highlightedIndex = getInitialValue(props, 'highlightedIndex');
1918
1918
  var inputValue = getInitialValue(props, 'inputValue');
1919
1919
  return {
1920
- highlightedIndex: highlightedIndex < 0 && selectedItem ? props.items.indexOf(selectedItem) : highlightedIndex,
1920
+ highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,
1921
1921
  isOpen: isOpen,
1922
1922
  selectedItem: selectedItem,
1923
1923
  inputValue: inputValue
@@ -1856,7 +1856,7 @@ function getInitialState(props) {
1856
1856
  var highlightedIndex = getInitialValue(props, 'highlightedIndex');
1857
1857
  var inputValue = getInitialValue(props, 'inputValue');
1858
1858
  return {
1859
- highlightedIndex: highlightedIndex < 0 && selectedItem ? props.items.indexOf(selectedItem) : highlightedIndex,
1859
+ highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,
1860
1860
  isOpen: isOpen,
1861
1861
  selectedItem: selectedItem,
1862
1862
  inputValue: inputValue
@@ -3179,7 +3179,7 @@
3179
3179
  var highlightedIndex = getInitialValue(props, 'highlightedIndex');
3180
3180
  var inputValue = getInitialValue(props, 'inputValue');
3181
3181
  return {
3182
- highlightedIndex: highlightedIndex < 0 && selectedItem ? props.items.indexOf(selectedItem) : highlightedIndex,
3182
+ highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,
3183
3183
  isOpen: isOpen,
3184
3184
  selectedItem: selectedItem,
3185
3185
  inputValue: inputValue