diff --git a/src/scripts/h5p-crossword-input.js b/src/scripts/h5p-crossword-input.js index 430aa08..e756b30 100644 --- a/src/scripts/h5p-crossword-input.js +++ b/src/scripts/h5p-crossword-input.js @@ -647,6 +647,9 @@ export default class CrosswordInput { resize(params = {}) { if (params.height) { this.content.style.setProperty('--h5p-crossword-input-container-height', `${params.height}px`); + this.content.classList.toggle( + 'has-scrollbar', this.content.scrollHeight > this.content.clientHeight + ); } if (this.extraClueInstance) { diff --git a/src/styles/h5p-crossword.scss b/src/styles/h5p-crossword.scss index 9378d5e..149b40c 100644 --- a/src/styles/h5p-crossword.scss +++ b/src/styles/h5p-crossword.scss @@ -252,6 +252,10 @@ height: var(--h5p-crossword-input-container-height); overflow-y: auto; width: 50%; + + &.has-scrollbar { + padding-right: 1rem; + } } .h5p-crossword-input-fields-group {