@optionfactory/fml 9.0.0-rc36 → 9.0.0-rc37

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.
package/dist/fml.iife.js CHANGED
@@ -12152,6 +12152,19 @@ var fml = (function (exports) {
12152
12152
  }
12153
12153
  table.insertBefore(columns, table.tHead);
12154
12154
  }
12155
+ /**
12156
+ * Locks the widths of the columns again, on the rows now in the page, when
12157
+ * one of them holds something its column has no room for and that cannot
12158
+ * wrap: left as it is it would stick out of the table, and the rows would
12159
+ * scroll sideways for it.
12160
+ */
12161
+ #widenColumns() {
12162
+ const cramped = [...this.#body.querySelectorAll(':scope > tr > *')].some((cell) => cell.scrollWidth > cell.clientWidth + 1);
12163
+ if (cramped) {
12164
+ this.#unlockColumns();
12165
+ this.#lockColumns();
12166
+ }
12167
+ }
12155
12168
  #unlockColumns() {
12156
12169
  this.#body.parentElement?.querySelector(':scope > colgroup[data-ref=widths]')?.remove();
12157
12170
  }
@@ -12317,6 +12330,7 @@ var fml = (function (exports) {
12317
12330
  this.#total = answers.at(-1)?.response.size ?? this.#total;
12318
12331
  this.#body.parentElement?.setAttribute('aria-rowcount', String(this.#total + 1));
12319
12332
  this.#fitSpacers();
12333
+ this.#widenColumns();
12320
12334
  if (anchor) {
12321
12335
  this.#wrapper.scrollTop += anchor.getBoundingClientRect().top - anchorTop;
12322
12336
  }
@@ -12324,6 +12338,7 @@ var fml = (function (exports) {
12324
12338
  if (claim.stale) {
12325
12339
  return;
12326
12340
  }
12341
+ this.#widenColumns();
12327
12342
  if (anchor) {
12328
12343
  // the elements in the new rows have rendered since, which can change their height
12329
12344
  this.#wrapper.scrollTop += anchor.getBoundingClientRect().top - anchorTop;
@@ -12408,6 +12423,7 @@ var fml = (function (exports) {
12408
12423
  if (claim.stale) {
12409
12424
  return;
12410
12425
  }
12426
+ this.#widenColumns();
12411
12427
  this.removeAttribute('aria-busy');
12412
12428
  this.#countInView();
12413
12429
  for (const { pageRequest, response } of shown) {