Skip to content

bug: text area resizing needs some work #1190

@megahirt

Description

@megahirt

Describe the bug
The current text area resizing needs some work. I (Chris) have actually worked on this for nearly 8 hours and still have yet to achieve something that implements all the requirements. The current implementation on staging also utilizes extra JS/CSS that is probably not necessary.

Expected behavior

  1. The text area defaults to a single line width when there is either no content or a single line of content
  2. Switching between entries should appropriately size the text area to it's content
  3. Resizing the window should trigger a text area resize
  4. Enter text that results in additional lines should grow the text area appropriately
  5. Deleting text that results in fewer lines should shrink the text area appropriately

The current code implements number 4 completely (auto-grow) but has significant issues with numbers 1,2,3 and 5, with the shrink effect only reducing the size by 1px for each key-up or window resize event. This has the effect of the text area slowly approaching the correct size.

Video showing partial implementation currently shipped on v1.9
https://user-images.githubusercontent.com/3444521/135624012-8c70a2bc-44da-4b0d-8630-9f6136079915.mp4

Metadata

Metadata

Assignees

Labels

bugAn existing problem with our app in production

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions