fix slash menu dismissal and anchor
This commit is contained in:
@@ -18,7 +18,7 @@ pub(crate) struct SlashMenuViewProps {
|
||||
pub(crate) editor: TiptapEditorHandle,
|
||||
pub(crate) signals: SlashMenuSignals,
|
||||
pub(crate) runtime: SlashMenuRuntimeContext,
|
||||
pub(crate) anchor_style: Arc<dyn Fn() -> String + Send + Sync>,
|
||||
pub(crate) anchor_style: ReadSignal<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -213,7 +213,14 @@ pub(crate) fn slash_menu_view(props: SlashMenuViewProps) -> impl IntoView {
|
||||
<div
|
||||
class="slash-menu"
|
||||
data-testid="mnote-leptos-tiptap-slash-menu"
|
||||
style=anchor_style()
|
||||
style=move || {
|
||||
let style = anchor_style.get();
|
||||
if style.trim().is_empty() {
|
||||
"top:24px;left:24px;".to_string()
|
||||
} else {
|
||||
style
|
||||
}
|
||||
}
|
||||
>
|
||||
<div class="slash-list">
|
||||
{move || {
|
||||
|
||||
Reference in New Issue
Block a user