Skip to content

OLMIS-8191: Shared openlmis-long-text widen-then-wrap for table cells#86

Merged
mgrochalskisoldevelo merged 2 commits into
masterfrom
OLMIS-8191-longtext-wrap
Jul 22, 2026
Merged

OLMIS-8191: Shared openlmis-long-text widen-then-wrap for table cells#86
mgrochalskisoldevelo merged 2 commits into
masterfrom
OLMIS-8191-longtext-wrap

Conversation

@michaldev0

Copy link
Copy Markdown
Contributor

What

A single opt-in openlmis-long-text class for long free-text in constrained table columns: the field widens with its content up to a cap, then wraps.

  • Editable: a <textarea> measured and sized by the openlmisLongText directive.
  • Read-only: a <span> sized purely in CSS (width: max-content, capped by max-width).
  • Cap/floor as SCSS variables in common/_variables.scss.

Why

Replaces the earlier auto-resize approach (the directive was restrict: 'E' on every table textarea — #79 / #74) with one explicit opt-in that covers the editable and read-only sides consistently.

Notes

  • Karma covers the directive incl. a regression test for the hidden→shown height:0 collapse.
  • Consumed by the requisition-ui / stockmanagement-ui / fulfillment-ui / referencedata-ui PRs on the same branch — merge this first.

OLMIS-8191 / OLMIS-8192

@denys1204 denys1204 self-assigned this Jul 21, 2026
@denys1204

Copy link
Copy Markdown
Contributor

Reviewed as part of the OLMIS-8191/8192 rollout. Solid refactor — the opt-in openlmis-long-text class in place of a restrict:'E' directive on every textarea is a clean improvement, editable and read-only are handled consistently, and the hidden→shown guard (offsetParent === null) with its regression test is a good catch.
Merge coordination note: this PR removes the global .openlmis-table td > div.input-control > textarea styling in favour of the opt-in class, which changes the default for every consumer. I checked all four consumers on the branch — requisition #87, stockmanagement #99, fulfillment #16, referencedata #85 — and their table free-text fields are migrated to the class, so there are no orphaned table textareas. Please keep them merging as a set, with this one first as noted.
Minor: resize runs only on a value change, so a pre-filled textarea hidden at link time and shown later without a value change won't be sized (low impact; relevant for ng-show fields — see #99). CHANGELOG mentions only 8191 (8192 also applies).
LGTM, merging as a set.

The openlmisLongText directive only re-measured on value change, so a
pre-filled textarea that starts hidden (ng-show/ng-if) and is shown later
stayed at one row until edited. Watch visibility (offsetParent) too, so the
field is sized once it becomes visible. Adds a regression test and notes
OLMIS-8192 in the changelog.
@sonarqubecloud

Copy link
Copy Markdown

@mgrochalskisoldevelo
mgrochalskisoldevelo merged commit 749e767 into master Jul 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants