mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-18 17:31:53 +08:00
fix(mobile): classic toolbar disappearing when pressing dropdowns
This commit is contained in:
parent
ef9e21147f
commit
c1280be74a
@ -27,18 +27,21 @@ const TPL = `\
|
||||
}
|
||||
|
||||
body.mobile .classic-toolbar-widget.visible {
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
height: 50vh;
|
||||
overflow-x: auto;
|
||||
background: var(--main-background-color);
|
||||
background: transparent;
|
||||
z-index: 500;
|
||||
}
|
||||
|
||||
body.mobile .classic-toolbar-widget .ck.ck-toolbar {
|
||||
position: absolute;
|
||||
background-color: var(--main-background-color);
|
||||
}
|
||||
</style>
|
||||
`;
|
||||
|
@ -228,11 +228,19 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
$classicToolbarWidget.addClass("visible");
|
||||
});
|
||||
|
||||
// Hide the formatting toolbar
|
||||
this.$editor.on("focusout", (e) => {
|
||||
setTimeout(() => {
|
||||
if (document.activeElement !== this.$editor[0]) {
|
||||
$classicToolbarWidget.removeClass("visible");
|
||||
if (document.activeElement === this.$editor[0]) {
|
||||
// Editor has been refocused.
|
||||
return;
|
||||
}
|
||||
|
||||
if ($classicToolbarWidget[0].contains(document.activeElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$classicToolbarWidget.removeClass("visible");
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user