@citolab/qti-components 9.6.0 → 9.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8813,7 +8813,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
8813
8813
  case "resize":
8814
8814
  if (typeof data.height === "number" && this.iframe) {
8815
8815
  this.iframe.style.height = `${data.height}px`;
8816
- this.iframe.style.width = `${data.width}px`;
8817
8816
  }
8818
8817
  break;
8819
8818
  case "console":
@@ -9450,6 +9449,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9450
9449
  }
9451
9450
  #pci-container {
9452
9451
  width: 100%;
9452
+ /* Keeps the first and last child's margins inside, so scrollHeight is the full height. */
9453
+ display: flow-root;
9453
9454
  }
9454
9455
  qti-interaction-markup {
9455
9456
  display: block;
@@ -10203,7 +10204,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
10203
10204
  let previousHeight = 0;
10204
10205
  const notifyResize = () => {
10205
10206
  const container = document.getElementById('pci-container');
10206
- const newHeight = container.scrollHeight + 100;
10207
+ // The content's own height (subpixel, rounded up) or what overflows it, e.g. an open popup.
10208
+ const newHeight = Math.max(Math.ceil(container.getBoundingClientRect().height), container.scrollHeight);
10207
10209
  if (newHeight !== previousHeight) {
10208
10210
  previousHeight = newHeight;
10209
10211
  clearTimeout(resizeTimeout);
@@ -11975,4 +11977,4 @@ export {
11975
11977
  elements31 as elements21,
11976
11978
  qtiInteractionElements
11977
11979
  };
11978
- //# sourceMappingURL=chunk-LOKULHVY.js.map
11980
+ //# sourceMappingURL=chunk-4HQML3K4.js.map