Skip to content

Commit 7cd38c2

Browse files
authored
Merge pull request #11963 from nanaya/spoilerbox-height-reset
Fix spoiler box height not reset
2 parents 66445d0 + 66351ec commit 7cd38c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resources/js/core/spoilerbox.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function expand(e: JQuery.ClickEvent) {
1010

1111
const container = htmlElementOrNull(e.target)?.closest('.js-spoilerbox')
1212
?? fail('spoiler container is missing');
13-
const body = container.querySelector(':scope > .js-spoilerbox__body')
13+
const body = htmlElementOrNull(container.querySelector(':scope > .js-spoilerbox__body'))
1414
?? fail('spoiler body is missing');
1515

1616
const toggle = container.classList.toggle('js-spoilerbox--open')
@@ -20,6 +20,7 @@ function expand(e: JQuery.ClickEvent) {
2020
$(body).stop()[toggle]({
2121
complete(this: void) {
2222
$.publish('sync-height:force');
23+
body.style.height = '';
2324
},
2425
});
2526
}

0 commit comments

Comments
 (0)