downshift 6.1.9 → 6.1.10

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.
@@ -188,7 +188,7 @@ function getA11yStatusMessage$1(_ref2) {
188
188
  }
189
189
 
190
190
  if (resultCount !== previousResultCount) {
191
- return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter key to select.";
191
+ return `${resultCount} result${resultCount === 1 ? ' is' : 's are'} available, use up and down arrow keys to navigate. Press Enter key to select.`;
192
192
  }
193
193
 
194
194
  return '';
@@ -244,7 +244,7 @@ function getElementProps(element) {
244
244
 
245
245
  function requiredProp(fnName, propName) {
246
246
  // eslint-disable-next-line no-console
247
- console.error("The property \"" + propName + "\" is required in \"" + fnName + "\"");
247
+ console.error(`The property "${propName}" is required in "${fnName}"`);
248
248
  }
249
249
 
250
250
  const stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];
@@ -314,7 +314,7 @@ function normalizeArrowKey(event) {
314
314
  /* istanbul ignore next (ie) */
315
315
 
316
316
  if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {
317
- return "Arrow" + key;
317
+ return `Arrow${key}`;
318
318
  }
319
319
 
320
320
  return key;
@@ -438,14 +438,14 @@ let validateControlledUnchanged = noop;
438
438
 
439
439
  if (process.env.NODE_ENV !== 'production') {
440
440
  validateControlledUnchanged = (state, prevProps, nextProps) => {
441
- const warningDescription = "This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";
441
+ const warningDescription = `This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props`;
442
442
  Object.keys(state).forEach(propKey => {
443
443
  if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {
444
444
  // eslint-disable-next-line no-console
445
- console.error("downshift: A component has changed the controlled prop \"" + propKey + "\" to be uncontrolled. " + warningDescription);
445
+ console.error(`downshift: A component has changed the controlled prop "${propKey}" to be uncontrolled. ${warningDescription}`);
446
446
  } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {
447
447
  // eslint-disable-next-line no-console
448
- console.error("downshift: A component has changed the uncontrolled prop \"" + propKey + "\" to be controlled. " + warningDescription);
448
+ console.error(`downshift: A component has changed the uncontrolled prop "${propKey}" to be controlled. ${warningDescription}`);
449
449
  }
450
450
  });
451
451
  };
@@ -554,12 +554,12 @@ const Downshift = /*#__PURE__*/(() => {
554
554
 
555
555
  super(_props);
556
556
  _this = this;
557
- this.id = this.props.id || "downshift-" + generateId();
558
- this.menuId = this.props.menuId || this.id + "-menu";
559
- this.labelId = this.props.labelId || this.id + "-label";
560
- this.inputId = this.props.inputId || this.id + "-input";
557
+ this.id = this.props.id || `downshift-${generateId()}`;
558
+ this.menuId = this.props.menuId || `${this.id}-menu`;
559
+ this.labelId = this.props.labelId || `${this.id}-label`;
560
+ this.inputId = this.props.inputId || `${this.id}-input`;
561
561
 
562
- this.getItemId = this.props.getItemId || (index => this.id + "-item-" + index);
562
+ this.getItemId = this.props.getItemId || (index => `${this.id}-item-${index}`);
563
563
 
564
564
  this.input = null;
565
565
  this.items = [];
@@ -1684,7 +1684,7 @@ function validateGetMenuPropsCalledCorrectly(node, _ref3) {
1684
1684
 
1685
1685
  if (!node) {
1686
1686
  // eslint-disable-next-line no-console
1687
- console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
1687
+ console.error(`downshift: The ref prop "${refKey}" from getMenuProps was not applied correctly on your menu element.`);
1688
1688
  }
1689
1689
  }
1690
1690
 
@@ -1700,12 +1700,12 @@ function validateGetRootPropsCalledCorrectly(element, _ref4) {
1700
1700
  console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');
1701
1701
  } else if (!isComposite && refKeySpecified) {
1702
1702
  // eslint-disable-next-line no-console
1703
- console.error("downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"" + refKey + "\"");
1703
+ console.error(`downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "${refKey}"`);
1704
1704
  }
1705
1705
 
1706
1706
  if (!reactIs.isForwardRef(element) && !getElementProps(element)[refKey]) {
1707
1707
  // eslint-disable-next-line no-console
1708
- console.error("downshift: You must apply the ref prop \"" + refKey + "\" from getRootProps onto your root element.");
1708
+ console.error(`downshift: You must apply the ref prop "${refKey}" from getRootProps onto your root element.`);
1709
1709
  }
1710
1710
  }
1711
1711
 
@@ -1743,7 +1743,7 @@ function invokeOnChangeHandler(key, action, state, newState) {
1743
1743
  props,
1744
1744
  type
1745
1745
  } = action;
1746
- const handler = "on" + capitalizeString(key) + "Change";
1746
+ const handler = `on${capitalizeString(key)}Change`;
1747
1747
 
1748
1748
  if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {
1749
1749
  props[handler]({
@@ -1777,7 +1777,7 @@ function getA11ySelectionMessage(selectionParameters) {
1777
1777
  selectedItem,
1778
1778
  itemToString: itemToStringLocal
1779
1779
  } = selectionParameters;
1780
- return selectedItem ? itemToStringLocal(selectedItem) + " has been selected." : '';
1780
+ return selectedItem ? `${itemToStringLocal(selectedItem)} has been selected.` : '';
1781
1781
  }
1782
1782
  /**
1783
1783
  * Debounced call for updating the a11y message.
@@ -1792,7 +1792,7 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window
1792
1792
 
1793
1793
  function useElementIds(_ref) {
1794
1794
  let {
1795
- id = "downshift-" + generateId(),
1795
+ id = `downshift-${generateId()}`,
1796
1796
  labelId,
1797
1797
  menuId,
1798
1798
  getItemId,
@@ -1800,11 +1800,11 @@ function useElementIds(_ref) {
1800
1800
  inputId
1801
1801
  } = _ref;
1802
1802
  const elementIdsRef = react.useRef({
1803
- labelId: labelId || id + "-label",
1804
- menuId: menuId || id + "-menu",
1805
- getItemId: getItemId || (index => id + "-item-" + index),
1806
- toggleButtonId: toggleButtonId || id + "-toggle-button",
1807
- inputId: inputId || id + "-input"
1803
+ labelId: labelId || `${id}-label`,
1804
+ menuId: menuId || `${id}-menu`,
1805
+ getItemId: getItemId || (index => `${id}-item-${index}`),
1806
+ toggleButtonId: toggleButtonId || `${id}-toggle-button`,
1807
+ inputId: inputId || `${id}-input`
1808
1808
  });
1809
1809
  return elementIdsRef.current;
1810
1810
  }
@@ -1830,7 +1830,7 @@ function isAcceptedCharacterKey(key) {
1830
1830
  }
1831
1831
 
1832
1832
  function capitalizeString(string) {
1833
- return "" + string.slice(0, 1).toUpperCase() + string.slice(1);
1833
+ return `${string.slice(0, 1).toUpperCase()}${string.slice(1)}`;
1834
1834
  }
1835
1835
 
1836
1836
  function useLatestRef(val) {
@@ -1915,7 +1915,7 @@ function getDefaultValue$1(props, propKey, defaultStateValues) {
1915
1915
  defaultStateValues = dropdownDefaultStateValues;
1916
1916
  }
1917
1917
 
1918
- const defaultValue = props["default" + capitalizeString(propKey)];
1918
+ const defaultValue = props[`default${capitalizeString(propKey)}`];
1919
1919
 
1920
1920
  if (defaultValue !== undefined) {
1921
1921
  return defaultValue;
@@ -1935,7 +1935,7 @@ function getInitialValue$1(props, propKey, defaultStateValues) {
1935
1935
  return value;
1936
1936
  }
1937
1937
 
1938
- const initialValue = props["initial" + capitalizeString(propKey)];
1938
+ const initialValue = props[`initial${capitalizeString(propKey)}`];
1939
1939
 
1940
1940
  if (initialValue !== undefined) {
1941
1941
  return initialValue;
@@ -2089,7 +2089,7 @@ if (process.env.NODE_ENV !== 'production') {
2089
2089
  if (isInitialMountRef.current) {
2090
2090
  if (!Object.keys(propCallInfo).length) {
2091
2091
  // eslint-disable-next-line no-console
2092
- console.error("downshift: You forgot to call the " + propKey + " getter function on your component / element.");
2092
+ console.error(`downshift: You forgot to call the ${propKey} getter function on your component / element.`);
2093
2093
  return;
2094
2094
  }
2095
2095
  }
@@ -2102,7 +2102,7 @@ if (process.env.NODE_ENV !== 'production') {
2102
2102
 
2103
2103
  if ((!elementRef || !elementRef.current) && !suppressRefError) {
2104
2104
  // eslint-disable-next-line no-console
2105
- console.error("downshift: The ref prop \"" + refKey + "\" from " + propKey + " was not applied correctly on your element.");
2105
+ console.error(`downshift: The ref prop "${refKey}" from ${propKey} was not applied correctly on your element.`);
2106
2106
  }
2107
2107
  });
2108
2108
  isInitialMountRef.current = false;
@@ -2423,7 +2423,7 @@ function downshiftSelectReducer(state, action) {
2423
2423
  case ToggleButtonKeyDownCharacter:
2424
2424
  {
2425
2425
  const lowercasedKey = action.key;
2426
- const inputValue = "" + state.inputValue + lowercasedKey;
2426
+ const inputValue = `${state.inputValue}${lowercasedKey}`;
2427
2427
  const itemIndex = getItemIndexByCharacterKey({
2428
2428
  keysSoFar: inputValue,
2429
2429
  highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,
@@ -2494,7 +2494,7 @@ function downshiftSelectReducer(state, action) {
2494
2494
  case MenuKeyDownCharacter:
2495
2495
  {
2496
2496
  const lowercasedKey = action.key;
2497
- const inputValue = "" + state.inputValue + lowercasedKey;
2497
+ const inputValue = `${state.inputValue}${lowercasedKey}`;
2498
2498
  const highlightedIndex = getItemIndexByCharacterKey({
2499
2499
  keysSoFar: inputValue,
2500
2500
  highlightedIndex: state.highlightedIndex,
@@ -2933,7 +2933,7 @@ function useSelect(userProps) {
2933
2933
  id: elementIds.toggleButtonId,
2934
2934
  'aria-haspopup': 'listbox',
2935
2935
  'aria-expanded': latest.current.state.isOpen,
2936
- 'aria-labelledby': elementIds.labelId + " " + elementIds.toggleButtonId,
2936
+ 'aria-labelledby': `${elementIds.labelId} ${elementIds.toggleButtonId}`,
2937
2937
  ...rest
2938
2938
  };
2939
2939
 
@@ -2987,7 +2987,7 @@ function useSelect(userProps) {
2987
2987
 
2988
2988
  const itemProps = {
2989
2989
  role: 'option',
2990
- 'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
2990
+ 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
2991
2991
  id: elementIds.getItemId(itemIndex),
2992
2992
  [refKey]: handleRefs(ref, itemNode => {
2993
2993
  if (itemNode) {
@@ -3460,10 +3460,11 @@ function useCombobox(userProps) {
3460
3460
  });
3461
3461
  },
3462
3462
 
3463
- Escape() {
3463
+ Escape(event) {
3464
3464
  const latestState = latest.current.state;
3465
3465
 
3466
3466
  if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {
3467
+ event.preventDefault();
3467
3468
  dispatch({
3468
3469
  type: InputKeyDownEscape
3469
3470
  });
@@ -3572,7 +3573,7 @@ function useCombobox(userProps) {
3572
3573
  }
3573
3574
  }),
3574
3575
  role: 'option',
3575
- 'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
3576
+ 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
3576
3577
  id: elementIds.getItemId(itemIndex),
3577
3578
  ...(!rest.disabled && {
3578
3579
  onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
@@ -3858,7 +3859,7 @@ function getA11yRemovalMessage(selectionParameters) {
3858
3859
  removedSelectedItem,
3859
3860
  itemToString: itemToStringLocal
3860
3861
  } = selectionParameters;
3861
- return itemToStringLocal(removedSelectedItem) + " has been removed.";
3862
+ return `${itemToStringLocal(removedSelectedItem)} has been removed.`;
3862
3863
  }
3863
3864
 
3864
3865
  const propTypes = {
@@ -179,7 +179,7 @@ function getA11yStatusMessage$1(_ref2) {
179
179
  }
180
180
 
181
181
  if (resultCount !== previousResultCount) {
182
- return resultCount + " result" + (resultCount === 1 ? ' is' : 's are') + " available, use up and down arrow keys to navigate. Press Enter key to select.";
182
+ return `${resultCount} result${resultCount === 1 ? ' is' : 's are'} available, use up and down arrow keys to navigate. Press Enter key to select.`;
183
183
  }
184
184
 
185
185
  return '';
@@ -235,7 +235,7 @@ function getElementProps(element) {
235
235
 
236
236
  function requiredProp(fnName, propName) {
237
237
  // eslint-disable-next-line no-console
238
- console.error("The property \"" + propName + "\" is required in \"" + fnName + "\"");
238
+ console.error(`The property "${propName}" is required in "${fnName}"`);
239
239
  }
240
240
 
241
241
  const stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];
@@ -305,7 +305,7 @@ function normalizeArrowKey(event) {
305
305
  /* istanbul ignore next (ie) */
306
306
 
307
307
  if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {
308
- return "Arrow" + key;
308
+ return `Arrow${key}`;
309
309
  }
310
310
 
311
311
  return key;
@@ -429,14 +429,14 @@ let validateControlledUnchanged = noop;
429
429
 
430
430
  if (process.env.NODE_ENV !== 'production') {
431
431
  validateControlledUnchanged = (state, prevProps, nextProps) => {
432
- const warningDescription = "This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";
432
+ const warningDescription = `This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props`;
433
433
  Object.keys(state).forEach(propKey => {
434
434
  if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {
435
435
  // eslint-disable-next-line no-console
436
- console.error("downshift: A component has changed the controlled prop \"" + propKey + "\" to be uncontrolled. " + warningDescription);
436
+ console.error(`downshift: A component has changed the controlled prop "${propKey}" to be uncontrolled. ${warningDescription}`);
437
437
  } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {
438
438
  // eslint-disable-next-line no-console
439
- console.error("downshift: A component has changed the uncontrolled prop \"" + propKey + "\" to be controlled. " + warningDescription);
439
+ console.error(`downshift: A component has changed the uncontrolled prop "${propKey}" to be controlled. ${warningDescription}`);
440
440
  }
441
441
  });
442
442
  };
@@ -545,12 +545,12 @@ const Downshift = /*#__PURE__*/(() => {
545
545
 
546
546
  super(_props);
547
547
  _this = this;
548
- this.id = this.props.id || "downshift-" + generateId();
549
- this.menuId = this.props.menuId || this.id + "-menu";
550
- this.labelId = this.props.labelId || this.id + "-label";
551
- this.inputId = this.props.inputId || this.id + "-input";
548
+ this.id = this.props.id || `downshift-${generateId()}`;
549
+ this.menuId = this.props.menuId || `${this.id}-menu`;
550
+ this.labelId = this.props.labelId || `${this.id}-label`;
551
+ this.inputId = this.props.inputId || `${this.id}-input`;
552
552
 
553
- this.getItemId = this.props.getItemId || (index => this.id + "-item-" + index);
553
+ this.getItemId = this.props.getItemId || (index => `${this.id}-item-${index}`);
554
554
 
555
555
  this.input = null;
556
556
  this.items = [];
@@ -1675,7 +1675,7 @@ function validateGetMenuPropsCalledCorrectly(node, _ref3) {
1675
1675
 
1676
1676
  if (!node) {
1677
1677
  // eslint-disable-next-line no-console
1678
- console.error("downshift: The ref prop \"" + refKey + "\" from getMenuProps was not applied correctly on your menu element.");
1678
+ console.error(`downshift: The ref prop "${refKey}" from getMenuProps was not applied correctly on your menu element.`);
1679
1679
  }
1680
1680
  }
1681
1681
 
@@ -1691,12 +1691,12 @@ function validateGetRootPropsCalledCorrectly(element, _ref4) {
1691
1691
  console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');
1692
1692
  } else if (!isComposite && refKeySpecified) {
1693
1693
  // eslint-disable-next-line no-console
1694
- console.error("downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"" + refKey + "\"");
1694
+ console.error(`downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "${refKey}"`);
1695
1695
  }
1696
1696
 
1697
1697
  if (!isForwardRef(element) && !getElementProps(element)[refKey]) {
1698
1698
  // eslint-disable-next-line no-console
1699
- console.error("downshift: You must apply the ref prop \"" + refKey + "\" from getRootProps onto your root element.");
1699
+ console.error(`downshift: You must apply the ref prop "${refKey}" from getRootProps onto your root element.`);
1700
1700
  }
1701
1701
  }
1702
1702
 
@@ -1734,7 +1734,7 @@ function invokeOnChangeHandler(key, action, state, newState) {
1734
1734
  props,
1735
1735
  type
1736
1736
  } = action;
1737
- const handler = "on" + capitalizeString(key) + "Change";
1737
+ const handler = `on${capitalizeString(key)}Change`;
1738
1738
 
1739
1739
  if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {
1740
1740
  props[handler]({
@@ -1768,7 +1768,7 @@ function getA11ySelectionMessage(selectionParameters) {
1768
1768
  selectedItem,
1769
1769
  itemToString: itemToStringLocal
1770
1770
  } = selectionParameters;
1771
- return selectedItem ? itemToStringLocal(selectedItem) + " has been selected." : '';
1771
+ return selectedItem ? `${itemToStringLocal(selectedItem)} has been selected.` : '';
1772
1772
  }
1773
1773
  /**
1774
1774
  * Debounced call for updating the a11y message.
@@ -1783,7 +1783,7 @@ const useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window
1783
1783
 
1784
1784
  function useElementIds(_ref) {
1785
1785
  let {
1786
- id = "downshift-" + generateId(),
1786
+ id = `downshift-${generateId()}`,
1787
1787
  labelId,
1788
1788
  menuId,
1789
1789
  getItemId,
@@ -1791,11 +1791,11 @@ function useElementIds(_ref) {
1791
1791
  inputId
1792
1792
  } = _ref;
1793
1793
  const elementIdsRef = useRef({
1794
- labelId: labelId || id + "-label",
1795
- menuId: menuId || id + "-menu",
1796
- getItemId: getItemId || (index => id + "-item-" + index),
1797
- toggleButtonId: toggleButtonId || id + "-toggle-button",
1798
- inputId: inputId || id + "-input"
1794
+ labelId: labelId || `${id}-label`,
1795
+ menuId: menuId || `${id}-menu`,
1796
+ getItemId: getItemId || (index => `${id}-item-${index}`),
1797
+ toggleButtonId: toggleButtonId || `${id}-toggle-button`,
1798
+ inputId: inputId || `${id}-input`
1799
1799
  });
1800
1800
  return elementIdsRef.current;
1801
1801
  }
@@ -1821,7 +1821,7 @@ function isAcceptedCharacterKey(key) {
1821
1821
  }
1822
1822
 
1823
1823
  function capitalizeString(string) {
1824
- return "" + string.slice(0, 1).toUpperCase() + string.slice(1);
1824
+ return `${string.slice(0, 1).toUpperCase()}${string.slice(1)}`;
1825
1825
  }
1826
1826
 
1827
1827
  function useLatestRef(val) {
@@ -1906,7 +1906,7 @@ function getDefaultValue$1(props, propKey, defaultStateValues) {
1906
1906
  defaultStateValues = dropdownDefaultStateValues;
1907
1907
  }
1908
1908
 
1909
- const defaultValue = props["default" + capitalizeString(propKey)];
1909
+ const defaultValue = props[`default${capitalizeString(propKey)}`];
1910
1910
 
1911
1911
  if (defaultValue !== undefined) {
1912
1912
  return defaultValue;
@@ -1926,7 +1926,7 @@ function getInitialValue$1(props, propKey, defaultStateValues) {
1926
1926
  return value;
1927
1927
  }
1928
1928
 
1929
- const initialValue = props["initial" + capitalizeString(propKey)];
1929
+ const initialValue = props[`initial${capitalizeString(propKey)}`];
1930
1930
 
1931
1931
  if (initialValue !== undefined) {
1932
1932
  return initialValue;
@@ -2080,7 +2080,7 @@ if (process.env.NODE_ENV !== 'production') {
2080
2080
  if (isInitialMountRef.current) {
2081
2081
  if (!Object.keys(propCallInfo).length) {
2082
2082
  // eslint-disable-next-line no-console
2083
- console.error("downshift: You forgot to call the " + propKey + " getter function on your component / element.");
2083
+ console.error(`downshift: You forgot to call the ${propKey} getter function on your component / element.`);
2084
2084
  return;
2085
2085
  }
2086
2086
  }
@@ -2093,7 +2093,7 @@ if (process.env.NODE_ENV !== 'production') {
2093
2093
 
2094
2094
  if ((!elementRef || !elementRef.current) && !suppressRefError) {
2095
2095
  // eslint-disable-next-line no-console
2096
- console.error("downshift: The ref prop \"" + refKey + "\" from " + propKey + " was not applied correctly on your element.");
2096
+ console.error(`downshift: The ref prop "${refKey}" from ${propKey} was not applied correctly on your element.`);
2097
2097
  }
2098
2098
  });
2099
2099
  isInitialMountRef.current = false;
@@ -2414,7 +2414,7 @@ function downshiftSelectReducer(state, action) {
2414
2414
  case ToggleButtonKeyDownCharacter:
2415
2415
  {
2416
2416
  const lowercasedKey = action.key;
2417
- const inputValue = "" + state.inputValue + lowercasedKey;
2417
+ const inputValue = `${state.inputValue}${lowercasedKey}`;
2418
2418
  const itemIndex = getItemIndexByCharacterKey({
2419
2419
  keysSoFar: inputValue,
2420
2420
  highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,
@@ -2485,7 +2485,7 @@ function downshiftSelectReducer(state, action) {
2485
2485
  case MenuKeyDownCharacter:
2486
2486
  {
2487
2487
  const lowercasedKey = action.key;
2488
- const inputValue = "" + state.inputValue + lowercasedKey;
2488
+ const inputValue = `${state.inputValue}${lowercasedKey}`;
2489
2489
  const highlightedIndex = getItemIndexByCharacterKey({
2490
2490
  keysSoFar: inputValue,
2491
2491
  highlightedIndex: state.highlightedIndex,
@@ -2924,7 +2924,7 @@ function useSelect(userProps) {
2924
2924
  id: elementIds.toggleButtonId,
2925
2925
  'aria-haspopup': 'listbox',
2926
2926
  'aria-expanded': latest.current.state.isOpen,
2927
- 'aria-labelledby': elementIds.labelId + " " + elementIds.toggleButtonId,
2927
+ 'aria-labelledby': `${elementIds.labelId} ${elementIds.toggleButtonId}`,
2928
2928
  ...rest
2929
2929
  };
2930
2930
 
@@ -2978,7 +2978,7 @@ function useSelect(userProps) {
2978
2978
 
2979
2979
  const itemProps = {
2980
2980
  role: 'option',
2981
- 'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
2981
+ 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
2982
2982
  id: elementIds.getItemId(itemIndex),
2983
2983
  [refKey]: handleRefs(ref, itemNode => {
2984
2984
  if (itemNode) {
@@ -3451,10 +3451,11 @@ function useCombobox(userProps) {
3451
3451
  });
3452
3452
  },
3453
3453
 
3454
- Escape() {
3454
+ Escape(event) {
3455
3455
  const latestState = latest.current.state;
3456
3456
 
3457
3457
  if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {
3458
+ event.preventDefault();
3458
3459
  dispatch({
3459
3460
  type: InputKeyDownEscape
3460
3461
  });
@@ -3563,7 +3564,7 @@ function useCombobox(userProps) {
3563
3564
  }
3564
3565
  }),
3565
3566
  role: 'option',
3566
- 'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
3567
+ 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,
3567
3568
  id: elementIds.getItemId(itemIndex),
3568
3569
  ...(!rest.disabled && {
3569
3570
  onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
@@ -3849,7 +3850,7 @@ function getA11yRemovalMessage(selectionParameters) {
3849
3850
  removedSelectedItem,
3850
3851
  itemToString: itemToStringLocal
3851
3852
  } = selectionParameters;
3852
- return itemToStringLocal(removedSelectedItem) + " has been removed.";
3853
+ return `${itemToStringLocal(removedSelectedItem)} has been removed.`;
3853
3854
  }
3854
3855
 
3855
3856
  const propTypes = {