This commit is contained in:
parent
3ced66f749
commit
d052c7a7aa
1 changed files with 13 additions and 15 deletions
|
@ -307,22 +307,10 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value)}</div>`;
|
|||
} else {
|
||||
viewsElement.classList.remove("av__views--show");
|
||||
}
|
||||
updateSearch(e, protyle)
|
||||
});
|
||||
searchInputElement.addEventListener("keydown", (event: KeyboardEvent) => {
|
||||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
if (event.key === "Enter") {
|
||||
e.removeAttribute("data-render");
|
||||
avRender(e, protyle)
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
searchInputElement.addEventListener("compositionend", (event: KeyboardEvent) => {
|
||||
if (event.key === "Enter") {
|
||||
// todo
|
||||
event.preventDefault();
|
||||
}
|
||||
searchInputElement.addEventListener("compositionend", () => {
|
||||
updateSearch(e, protyle)
|
||||
});
|
||||
searchInputElement.addEventListener("blur", (event: KeyboardEvent) => {
|
||||
if (event.isComposing) {
|
||||
|
@ -351,6 +339,16 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value)}</div>`;
|
|||
}
|
||||
};
|
||||
|
||||
let searchTimeout: number
|
||||
|
||||
const updateSearch = (e: HTMLElement, protyle: IProtyle) => {
|
||||
clearTimeout(searchTimeout)
|
||||
searchTimeout = window.setTimeout(() => {
|
||||
e.removeAttribute("data-render");
|
||||
avRender(e, protyle)
|
||||
}, Constants.TIMEOUT_INPUT);
|
||||
}
|
||||
|
||||
const refreshTimeouts: {
|
||||
[key: string]: number;
|
||||
} = {};
|
||||
|
|
Loading…
Add table
Reference in a new issue