Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link taps as Lexical commands #9

Open
amyworrall opened this issue Apr 5, 2023 · 0 comments
Open

Link taps as Lexical commands #9

amyworrall opened this issue Apr 5, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@amyworrall
Copy link
Contributor

Issue #8 involves building a UI for creating links within the playground.

This task is about handling what happens when a link is tapped within the editor.

Currently, LexicalView has a LexicalViewDelegate method, textView(_, shouldInteractWith:, in:, interatction:). This method is essentially proxying a UITextView delegate method. (Note that TextView is our UITextView subclass, and LexicalView is a wrapper view around this, so there's a couple of layers here.)

We don't want to use delegate methods as ways of extending Lexical, since Lexical is best extended by means of registering commands. However, this code was written long ago, before we used commands for everything!

Ideal behaviour

There's already a .linkTapped command, and we use it in LexicalReadOnlyView. We want to make these changes:

  • Make LexicalView dispatch the .linkTapped command, rather than calling a delegate method.
  • Add a default implementation for .linkTapped within Lexical core, that just hands the URL to UIApplication to open. (Users of Lexical can register their own handler at a higher priority if they want different behaviour.)
@amyworrall amyworrall added the good first issue Good for newcomers label Apr 5, 2023
@amyworrall amyworrall added this to the 0.1 initial release milestone Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant