diff --git a/src/main.ts b/src/main.ts index 64818c6..cfe24f0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -106,8 +106,8 @@ window.onload = function () { } const colorControlDom = document.querySelector('#color')! - colorControlDom.onchange = function () { - instance.command.executeColor(colorControlDom!.value) + colorControlDom.oninput = function () { + instance.command.executeColor(colorControlDom.value) } const colorDom = document.querySelector('.menu-item__color')! const colorSpanDom = colorDom.querySelector('span')! @@ -117,7 +117,7 @@ window.onload = function () { } const highlightControlDom = document.querySelector('#highlight')! - highlightControlDom.onchange = function () { + highlightControlDom.oninput = function () { instance.command.executeHighlight(highlightControlDom.value) } const highlightDom = document.querySelector('.menu-item__highlight')!