Skip to content

SelectableDecoratorNode#29

Open
amyworrall wants to merge 1 commit intomainfrom
pr29
Open

SelectableDecoratorNode#29
amyworrall wants to merge 1 commit intomainfrom
pr29

Conversation

@amyworrall
Copy link
Contributor

SelectableDecoratorNode
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
@facebook-github-bot
Copy link
Contributor

@amyworrall has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@amyworrall
Copy link
Contributor Author

Continuing my work on NodeSelection, here we have an actual working use case.

This diff does a number of things:

  • Made the various editing event handling methods on RangeSelection (e.g. deleteCharacter()) public as part of BaseSelection.
  • Documented BaseSelection
  • Fixed a logic bug in transferStartingElementPointToTextPoint()
  • Implemented more of NodeSelection, supporting deleting and replacing nodes
  • Further improvement of ResponderForNodeSelection, which is the thing that tracks keyboard input and events when the text view is not handling them. (Note, on iOS, if the TextView is handling events, then a caret or selection will be shown. To do something else, such as NodeSelection where we draw our own borders, we have to tell the TextView to stop handling events.)
  • Created a new class SelectableDecoratorNode, which handles the boilerplate for allowing the decorator to respond to clicks.
  • Created SelectableImageNode as an example for using this.

Future plans:

  • Support styling the border for selected SelectableDecoratorNodes
  • Support shift-tap multi-selection
  • When node selection becomes empty, automatically revert back to range selection
  • Further testing for edge cases when swapping between node and range selections, especially in cases where the swap is forced by incoming events.
  • On iOS, tap (aka click) handling does not fire a Lexical event: it is handled directly e.g. in the SelectableDecoratorNode class, and there's no way of hooking in earlier than that. Consider making SelectableDecoratorNode fire the Lexical event and also listen to its own event, instead of handling the tap directly.

@facebook-github-bot
Copy link
Contributor

Hi @amyworrall!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants