mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
🎨 Improve soft keyboard toolbar pop-up https://github.com/siyuan-note/siyuan/issues/16548
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
606e7d8d25
commit
de1a209e58
2 changed files with 3 additions and 3 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue