Page MenuHomePhabricator

[native] Select thread name when clicking `EditSettingButton`
Needs RevisionPublic

Authored by abosh on Sep 1 2022, 11:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 8:03 PM
Unknown Object (File)
Sat, Apr 13, 2:53 PM
Unknown Object (File)
Thu, Apr 4, 7:01 PM
Unknown Object (File)
Thu, Apr 4, 7:01 PM
Unknown Object (File)
Thu, Apr 4, 7:00 PM
Unknown Object (File)
Apr 2 2024, 1:00 AM
Unknown Object (File)
Feb 22 2024, 9:41 PM
Unknown Object (File)
Feb 22 2024, 7:11 PM
Subscribers

Details

Reviewers
atul
tomek
Summary

Related Linear issue here.

This diff selects the thread name when clicking the edit button in ThreadSettingsName, and also allows the viewer to view the entire thread name on multiple lines instead of only viewing a fixed portion of the thread name on a single line.

I'm pretty sure selecting the text on clicking the edit button was already meant to occur because the selectTextOnFocus prop is set to true already:

image.png (532×1 px, 107 KB)

But this wasn't happening because the only prop that's missing is the multiline prop.

According to this GitHub comment, setting the multiline prop to true can solve the issue of selectTextOnFocus not doing anything.

Test Plan

Tested on iOS and works as expected.

Before:

After:

On Android, it looks like neither the description nor thread name are selected when clicking on them. Not sure if this is expected behavior on Android (it existed prior to me making any changes), but this diff doesn't modify anything on Android.

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

abosh edited the test plan for this revision. (Show Details)
abosh added inline comments.
native/chat/settings/thread-settings-name.react.js
107

See https://github.com/facebook/react-native/issues/30585#issuecomment-749728829 for more on why this makes the selectTextOnFocus prop work.

tomek requested changes to this revision.Sep 5 2022, 8:24 AM

On your second video (when the request finishes) the height of the field seems to be a little glitchy - it jumps a bit. Could you fix that?

This revision now requires changes to proceed.Sep 5 2022, 8:24 AM