Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-02-04 13:00:46 +08:00
parent 606e7d8d25
commit de1a209e58
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 3 additions and 3 deletions

View file

@ -415,11 +415,11 @@ const renderKeyboardToolbar = () => {
};
export const showKeyboardToolbar = () => {
if (!showUtil || getSelection().rangeCount === 0) {
if (!showUtil) {
hideKeyboardToolbarUtil();
}
const toolbarElement = document.getElementById("keyboardToolbar");
if (!toolbarElement.classList.contains("fn__none")) {
if (!toolbarElement.classList.contains("fn__none") || getSelection().rangeCount === 0) {
return;
}
toolbarElement.classList.remove("fn__none");

View file

@ -31,7 +31,7 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
const wysisygElement = hasClosestByClassName(target, "protyle-wysiwyg", true);
if (!yDiff || Math.abs(yDiff) < 10) {
let editElement: HTMLElement;
if (["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "true") {
if (["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "readonly") {
editElement = target;
} else if (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false") {
editElement = hasClosestByAttribute(target, "contenteditable", "true") as HTMLElement;