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)
Sun, Apr 21, 5:53 PM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:22 AM
Unknown Object (File)
Wed, Apr 17, 6:17 AM
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
Lint Not Applicable
Unit
Tests Not Applicable

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

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

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