FIX: ensures correct updates on input and clear

This commit is contained in:
jjaffeux 2020-04-20 17:07:04 +02:00
parent 1fab87e976
commit f947865904
1 changed files with 14 additions and 2 deletions

View File

@ -227,6 +227,18 @@ export default {
node.value =
node.parentNode.dataset.default ||
(node.tagName === "SELECT" ? "none" : "");
processChange({
target: {
value:
node.parentNode.dataset.default ||
(node.tagName === "SELECT" ? "none" : ""),
dataset: {
key: node.dataset.key,
delimiter: node.dataset.delimiter
}
}
});
});
event.target.disabled = true;
@ -284,10 +296,10 @@ export default {
$cooked
.on("input", ".discourse-placeholder-value", inputEvent =>
debounce(this, processChange, inputEvent, 250)
debounce(this, processChange, inputEvent, 150)
)
.on("change", ".discourse-placeholder-select", inputEvent =>
debounce(this, processChange, inputEvent, 250)
debounce(this, processChange, inputEvent, 150)
);
later(_fillPlaceholders, 500);