Page MenuHomePhabricator

[10/n] Native Typeahead - SelectableTextInput for Android
ClosedPublic

Authored by ashoat on Feb 6 2023, 5:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 5:28 AM
Unknown Object (File)
Tue, Oct 29, 5:27 AM
Unknown Object (File)
Tue, Oct 29, 5:27 AM
Unknown Object (File)
Tue, Oct 29, 5:27 AM
Unknown Object (File)
Tue, Oct 29, 5:27 AM
Unknown Object (File)
Tue, Oct 29, 5:27 AM
Unknown Object (File)
Tue, Oct 29, 5:23 AM
Unknown Object (File)
Mon, Oct 28, 11:59 PM
Subscribers
None

Details

Summary

Putting this one up first, as it's the "base case". iOS basically has to do everything that Android does.

Depends on D6641

Test Plan
  • Tested both iOS and Android
  • Made sure there was no flicker
  • Tested @-tag in both middle and end of text
  • Tested moving cursor after selecting @-tag

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested review of this revision.Feb 6 2023, 6:05 PM
native/components/selectable-text-input.react.js
37 ↗(On Diff #22170)

I should remove this comment – we *are* doing something

tomek added 1 blocking reviewer(s): przemek.
tomek added inline comments.
native/components/selectable-text-input.react.js
60–62 ↗(On Diff #22170)

We can use a shorthand

73–75 ↗(On Diff #22170)

We can consider destructuring selection out of rest props because we're always overriding it here.

const {
  clearableTextInputRef,
  onUpdateSyncedSelectionData,
  onSelectionChange,
  selection,
  ...rest
} = props;

Remove inaccurate comment

This revision is now accepted and ready to land.Feb 7 2023, 2:28 PM
native/components/selectable-text-input.react.js
60 ↗(On Diff #22252)

It looks like we're not using onSelection when creating this component in ChatInputBar Is it there to keep compatibility with TextInput API (i.e. someone sometime in future may want to use that normal callback) or is there something I missed?

native/components/selectable-text-input.react.js
60 ↗(On Diff #22252)

Yes, we don't want to break compatibility. You can see we forward all TextInput props... SelectableTextInput is meant as a drop-in replacement for TextInput that addresses issues with selectable text