mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
a316785f70
commit
b72e67d378
1 changed files with 4 additions and 3 deletions
|
|
@ -331,23 +331,24 @@ export const bindSelectEvent = (protyle: IProtyle, data: IAV, menuElement: HTMLE
|
|||
if (!colData.options) {
|
||||
colData.options = [];
|
||||
}
|
||||
const listElement = menuElement.lastElementChild.lastElementChild as HTMLElement
|
||||
inputElement.addEventListener("input", (event: InputEvent) => {
|
||||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
menuElement.lastElementChild.innerHTML = filterSelectHTML(inputElement.value, colData.options);
|
||||
listElement.innerHTML = filterSelectHTML(inputElement.value, colData.options);
|
||||
});
|
||||
inputElement.addEventListener("compositionend", (event: InputEvent) => {
|
||||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
menuElement.lastElementChild.innerHTML = filterSelectHTML(inputElement.value, colData.options);
|
||||
listElement.innerHTML = filterSelectHTML(inputElement.value, colData.options);
|
||||
});
|
||||
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
|
||||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
let currentElement = upDownHint(menuElement.lastElementChild, event, "b3-menu__item--current");
|
||||
let currentElement = upDownHint(listElement, event, "b3-menu__item--current");
|
||||
if (event.key === "Enter") {
|
||||
if (!currentElement) {
|
||||
currentElement = menuElement.querySelector(".b3-menu__item--current");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue