Fix textboxes inside flatpickr popup to not cause the scheduled publishing overlay to submit when enter is pressed.

This commit is contained in:
Adam Nelson
2021-05-02 09:16:29 +10:00
committed by Sebastiaan Janssen
parent 33e980841f
commit 0bc9f3e322

View File

@@ -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();
}