kopia lustrzana https://github.com/wagtail/wagtail
Update CloneController - added/cleared events should not be cancelable
- While no code uses the event.preventDefault on these it's good practice to advise when cancelling will do nothingpull/12515/head
rodzic
b903b572d9
commit
93384a062e
client/src/controllers
|
@ -106,7 +106,7 @@ export class CloneController extends Controller<HTMLElement> {
|
|||
debounce(() => {
|
||||
this.element.classList.remove(...this.hideClasses);
|
||||
this.element.classList.add(...this.showClasses);
|
||||
this.dispatch('added');
|
||||
this.dispatch('added', { cancelable: false });
|
||||
}, this.showDelayValue || null /* run immediately if zero */)().then(() => {
|
||||
// Once complete, check if we should automatically clear the content after a delay
|
||||
const autoClearValue = this.autoClearValue || null;
|
||||
|
@ -141,7 +141,7 @@ export class CloneController extends Controller<HTMLElement> {
|
|||
debounce(noop, clearDelayValue)().then(() => {
|
||||
if (!this?.isClearing) return;
|
||||
this.containerTarget.innerHTML = '';
|
||||
this.dispatch('cleared');
|
||||
this.dispatch('cleared', { cancelable: false });
|
||||
this.isClearing = false;
|
||||
});
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue