Skip to content

Commit

Permalink
fix(LinkBubble): Don't open bubble when initializing the editor
Browse files Browse the repository at this point in the history
Fixes: #5855
Fixes: nextcloud/collectives#1296

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Jun 18, 2024
1 parent 0a6b3f6 commit ff982a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export function linkBubble(options) {
appendTransaction: (transactions, oldState, state) => {
const sameSelection = oldState?.selection.eq(state.selection)
const sameDoc = oldState?.doc.eq(state.doc)
if (sameSelection && sameDoc) {
// Prevent bubble from opening at editor initialisation
const initLoad = oldState?.doc.content.size === 2
if (initLoad || (sameSelection && sameDoc)) {
return
}
const active = activeLinkFromSelection(state)
Expand Down

0 comments on commit ff982a4

Please sign in to comment.