fix: insert link/media lands at the cursor and closes the overlay instead of breaking the editor

This commit is contained in:
2026-07-17 10:58:51 +02:00
parent b016f6d812
commit b517672663
6 changed files with 181 additions and 23 deletions

View File

@@ -155,7 +155,7 @@ defmodule BDS.Desktop.ShellLive.OverlayManager do
ShellOverlayComponents.markdown_link(result.title, result.canonical_url)}
)
socket
assign(socket, :shell_overlay, nil)
end
{%{kind: :insert_media}, %{type: :post, id: post_id}} ->
@@ -172,7 +172,7 @@ defmodule BDS.Desktop.ShellLive.OverlayManager do
end
Notify.parent({:post_editor_insert_content, post_id, syntax})
socket
assign(socket, :shell_overlay, nil)
end
_other ->
@@ -197,10 +197,11 @@ defmodule BDS.Desktop.ShellLive.OverlayManager do
if details do
Notify.parent({:post_editor_insert_content, post_id, details})
assign(socket, :shell_overlay, nil)
else
socket
end
socket
_other ->
socket
end