Page MenuHomePhabricator

[web] Description box shouldn't be resizable horizontally
ClosedPublic

Authored by rohan on Oct 19 2022, 9:34 AM.
Tags
None
Referenced Files
F3720598: D5388.id17744.diff
Wed, Jan 8, 12:34 PM
F3720597: D5388.id17659.diff
Wed, Jan 8, 12:34 PM
F3720592: D5388.id.diff
Wed, Jan 8, 12:34 PM
F3720572: D5388.diff
Wed, Jan 8, 12:31 PM
Unknown Object (File)
Nov 26 2024, 5:17 AM
Unknown Object (File)
Nov 25 2024, 10:39 PM
Unknown Object (File)
Nov 24 2024, 12:47 PM
Unknown Object (File)
Nov 24 2024, 12:46 PM

Details

Summary

Set the textarea to be resizable only vertically through it's supported CSS properties. Also set a min-width so it isn't resizable small
enough to cut out the description.

Linear: https://linear.app/comm/issue/ENG-2016/description-box-shouldnt-be-resizable-horizontally

Test Plan

Works as expected, and tested before & after this change.

Before

After

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan edited the test plan for this revision. (Show Details)
rohan edited the test plan for this revision. (Show Details)
rohan attached a referenced file: F203164: Before.mov. (Show Details)
rohan attached a referenced file: F203163: After.mov. (Show Details)

I'm not sure why Phabricator isn't rendering the before video properly, but if needed you can download the 15 second video to see what the current state is

rohan requested review of this revision.Oct 19 2022, 9:44 AM
atul added inline comments.
web/modals/threads/settings/thread-settings-general-tab.css
24 ↗(On Diff #17659)

Is it possible to set the minimum height based on the number of lines in textarea rather than hardcoding pixel values? I see that textarea has a rows prop, it would be nice if it had a minRows prop or something...

Can you do some brief research on this sort of alternative approach before landing? Feel free to land as is if you don't find anything

This revision is now accepted and ready to land.Oct 19 2022, 10:22 AM
web/modals/threads/settings/thread-settings-general-tab.css
24 ↗(On Diff #17659)

So it looks like the number of rows in the textArea is basically the number of \n or linebreaks when typing. This is pretty easy to get with RegEx, but if you don't have any linebreaks, then your text is just overflowing and going to the next line. This is still considered 1 row, so to get the true number of rows it seems like it involves some JS manipulation based on CSS attributes, but it doesn't seem very consistent from what I've seen.