We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93132ac commit 9dd67e0Copy full SHA for 9dd67e0
content_editor/static/content_editor/content_editor.js
@@ -413,8 +413,19 @@
413
indent = nextIndent
414
}
415
416
- while (stack.length) {
417
- closeSection(inlines[inlines.length - 1])
+ if (stack.length) {
+ // Cannot just use the last inline, it may be hidden. Find the last
418
+ // inline and use it for finding the place where all open sections
419
+ // should be closed visually.
420
+ let lastVisibleIndex = inlines.length - 1
421
+ while (
422
+ inlines[lastVisibleIndex].classList.contains("content-editor-hide")
423
+ ) {
424
+ --lastVisibleIndex
425
+ }
426
+ while (stack.length) {
427
+ closeSection(inlines[lastVisibleIndex])
428
429
430
431
for (const section of sectionsMap.values()) {
0 commit comments