Skip to content

Commit

Permalink
HFP-3956 Add padding to container if has scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Aug 6, 2024
1 parent d1c9a70 commit 78b6ff8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scripts/h5p-crossword-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions src/styles/h5p-crossword.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 78b6ff8

Please sign in to comment.