Skip to content

Commit

Permalink
add Enter validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BenOsodrac committed Jul 12, 2024
1 parent 5e38cbc commit 92e6138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ function FlatpickrInstance(
break;
// Save the entered Date on the input
case "Enter":
if(self.loadedPlugins.indexOf("monthSelect") !== -1|| self.config.noCalendar && self.config.enableTime) {
return;
}
const newDate = new Date(self._input.value);
setDate(newDate, true);
break;
Expand Down

0 comments on commit 92e6138

Please sign in to comment.