🎨 快照回车绑定

This commit is contained in:
Vanessa 2022-07-17 11:06:05 +08:00
parent ea245973ad
commit 7ee9691a8c
2 changed files with 8 additions and 2 deletions

View file

@ -66,9 +66,9 @@ export class Dialog {
});
}
public bindInput(inputElement: HTMLInputElement, enterEvent?: () => void) {
public bindInput(inputElement: HTMLInputElement | HTMLTextAreaElement, enterEvent?: () => void) {
inputElement.focus();
inputElement.addEventListener("keydown", (event) => {
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
if (event.isComposing) {
event.preventDefault();
return;