Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setHighlightedIndex(suggestedItems.length + getDateInMonth(today) - 1);
inputRef.current.focus();
};
const jumpMonth = amount => {
const nextDate = changeMonth(calendarDate, amount);
setCalendarDate(nextDate);
setHighlightedIndex(0);
};
return (
{
/* eslint-disable no-prototype-builtins */
if (changes.hasOwnProperty('inputValue')) {
// input changed because user typed
if (changes.type === Downshift.stateChangeTypes.changeInput) {
const date = parseInputToDate(changes.inputValue, intl.locale);
if (date === '') {
setSuggestedItems([]);
setHighlightedIndex(null);
} else {
setSuggestedItems([date]);
setHighlightedIndex(getDateInMonth(date) - 1);
setCalendarDate(date);