This commit is contained in:
Vanessa 2023-03-06 14:02:35 +08:00
parent ef5835a6c7
commit e4ff4f03cd
2 changed files with 2 additions and 2 deletions

View file

@ -78,7 +78,7 @@ const renderKeyboardToolbar = () => {
dynamicElements[1].querySelectorAll(".protyle-toolbar__item--current").forEach(item => {
item.classList.remove("protyle-toolbar__item--current");
});
const types = protyle.toolbar.getCurrentType();
const types = protyle.toolbar.getCurrentType(range);
types.forEach(item => {
if (["search-mark", "a", "block-ref", "virtual-block-ref", "text", "file-annotation-ref", "inline-math",
"inline-memo", "", "backslash"].includes(item)) {

View file

@ -315,7 +315,7 @@ export class Toolbar {
item.replaceWith(spanElement);
});
}
const toolbarElement = isMobile() ? document.querySelector("#keyboardToolbar .keyboard__dynamic") : this.element;
const toolbarElement = isMobile() ? document.querySelector("#keyboardToolbar .keyboard__dynamic").nextElementSibling : this.element;
const actionBtn = action === "toolbar" ? toolbarElement.querySelector(`[data-type="${type}"]`) : undefined;
const newNodes: Node[] = [];