0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 05:02:57 +01:00

Set datetimepicker events to bubble so that they trigger a filter form refresh

This commit is contained in:
Matt Westcott 2024-01-10 22:40:58 +00:00 committed by Thibaud Colas
parent be14465c4e
commit 7fd4e14f8e

View File

@ -44,7 +44,7 @@ function initDateChooser(id, opts) {
format: 'Y-m-d',
onGenerate: hideCurrent,
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},
@ -59,7 +59,7 @@ function initDateChooser(id, opts) {
format: 'Y-m-d',
onGenerate: hideCurrent,
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},
@ -79,7 +79,7 @@ function initTimeChooser(id, opts) {
scrollInput: false,
format: 'H:i',
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},
@ -92,7 +92,7 @@ function initTimeChooser(id, opts) {
datepicker: false,
format: 'H:i',
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},
@ -112,7 +112,7 @@ function initDateTimeChooser(id, opts) {
scrollInput: false,
onGenerate: hideCurrent,
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},
@ -125,7 +125,7 @@ function initDateTimeChooser(id, opts) {
format: 'Y-m-d H:i',
onGenerate: hideCurrent,
onChangeDateTime(_, $el) {
$el.get(0).dispatchEvent(new Event('change'));
$el.get(0).dispatchEvent(new Event('change', { bubbles: true }));
},
},
opts || {},