Skip to content

Build your personal knowledge base with Trilium Notes

client/collapsible blocks: fix an issue

Adorian Doran0cb43652d994
diff --git a/packages/ckeditor5-collapsible/src/collapsible-editing.ts b/packages/ckeditor5-collapsible/src/collapsible-editing.ts
index f810820a35..b31094800a 100644
--- a/packages/ckeditor5-collapsible/src/collapsible-editing.ts
+++ b/packages/ckeditor5-collapsible/src/collapsible-editing.ts
@@ -906,8 +906,12 @@ export default class CollapsibleEditing extends Plugin {
for (const details of this.findRevealed) {
if (!wanted.has(details)) {
- this.findRevealed.delete(details);
+ // Keep the entry in the set until the reveal is stripped: while it's present,
+ // onDetailsToggle's guard swallows the write-back from the DOM `toggle` that
+ // removing `open` fires (mirrors the reveal path below). setDetailsOpen's own
+ // no-op guard is the backstop where `toggle` fires asynchronously.
this.applyFindReveal(details, false);
+ this.findRevealed.delete(details);
}
}
for (const details of wanted) {