Skip to content

Commit b120216

Browse files
committed
VA-548 fix column count computed as zero and prevent elementWidth computed as Infinity
1 parent 2ab6de2 commit b120216

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scripts/h5p-multi-media-choice-content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export default class MultiMediaChoiceContent {
384384
const columnSpaceCount = this.optionList.getBoundingClientRect().width / (optionMinWidth + columnGap);
385385

386386
// Find the number of columns from whichever is smaller: space, max values and number of options
387-
const columns = Math.floor(
387+
const columns = Math.ceil(
388388
Math.min(columnSpaceCount, this.maxAlternativesPerRow, this.options.length)
389389
);
390390
const elementWidth = (this.optionList.getBoundingClientRect().width / columns) - columnGap;

0 commit comments

Comments
 (0)