MDL-79264 tiny_equation: Correct debounce method
The debounced method was being called immediately instead of being debounced.
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -66,6 +66,7 @@ const displayDialogue = async(editor) => {
|
||||
currentForm = root.querySelector(Selectors.elements.form);
|
||||
|
||||
const contextId = getContextId(editor);
|
||||
const debouncedPreviewUpdater = debounce(() => updatePreview(getContextId(editor)), 500);
|
||||
|
||||
$root.on(ModalEvents.hidden, () => {
|
||||
modalPromises.destroy();
|
||||
@@ -95,14 +96,14 @@ const displayDialogue = async(editor) => {
|
||||
modalPromises.destroy();
|
||||
}
|
||||
if (textArea) {
|
||||
debounce(updatePreview(contextId), 500);
|
||||
debouncedPreviewUpdater();
|
||||
}
|
||||
});
|
||||
|
||||
root.addEventListener('keyup', (e) => {
|
||||
const textArea = e.target.closest(Selectors.elements.equationTextArea);
|
||||
if (textArea) {
|
||||
debounce(updatePreview(contextId), 500);
|
||||
debouncedPreviewUpdater();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user