Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function handleResetPossibleDate() {
setPossibleDate(null);
}
function handleSelect(selectedDate) {
setHasParsingError(false);
hideCalendar();
handleChange(selectedDate);
}
const hasInputError = extendedInputProps && extendedInputProps.hasError;
const hasErrorValue = hasError || hasParsingError || hasInputError;
const inputText =
(inputRef && isElementContainsFocus(inputRef.current)) || hasErrorValue
? inputtedString
: formatDateProp(humanFormat);
return (
<input>}
id={id}
isDisabled={isDisabled}
function handleClosePopover() {
if (!isElementContainsFocus(calendarRef.current) && !isElementContainsFocus(inputRef.current)) {
if (!hasParsingError) {
setInputtedString(formatDateProp(dataFormat));
}
hideCalendar();
}
}
window.requestAnimationFrame(() => {
if (!isElementContainsFocus(calendarRef.current)) {
handleInputConfirm();
}
});
}