Skip to content

Commit

Permalink
Fix textboxes inside flatpickr popup to not cause the scheduled publi…
Browse files Browse the repository at this point in the history
…shing overlay to submit when enter is pressed.
  • Loading branch information
Adam Nelson authored and nul800sebastiaan committed Aug 6, 2021
1 parent 33e9808 commit 0bc9f3e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,25 @@
* @param {any} type publish or unpublish
*/
function datePickerShow(variant, type) {
var activeDatePickerInstance;
if (type === 'publish') {
variant.releaseDatePickerOpen = true;
activeDatePickerInstance = variant.releaseDatePickerInstance;
} else if (type === 'unpublish') {
variant.expireDatePickerOpen = true;
activeDatePickerInstance = variant.expireDatePickerInstance;
}

// Prevent enter key in time fields from submitting the overlay before the associated input gets the updated time
if (activeDatePickerInstance && !activeDatePickerInstance.hourElement.hasAttribute("overlay-submit-on-enter"))
{
activeDatePickerInstance.hourElement.setAttribute("overlay-submit-on-enter", "false");
}
if (activeDatePickerInstance && !activeDatePickerInstance.minuteElement.hasAttribute("overlay-submit-on-enter"))
{
activeDatePickerInstance.minuteElement.setAttribute("overlay-submit-on-enter", "false");
}

checkForBackdropClick();
$scope.model.disableSubmitButton = !canSchedule();
}
Expand Down

0 comments on commit 0bc9f3e

Please sign in to comment.