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)
Wed, Oct 23, 10:05 AM
Unknown Object (File)
Oct 22 2024, 12:07 PM
Unknown Object (File)
Oct 22 2024, 2:13 AM
Unknown Object (File)
Oct 21 2024, 9:52 PM
Unknown Object (File)
Oct 18 2024, 5:15 PM
Unknown Object (File)
Oct 17 2024, 10:50 AM
Unknown Object (File)
Oct 15 2024, 2:30 AM
Unknown Object (File)
Sep 25 2024, 1:00 AM
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