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

[Investigate] Remove SelectableText in favor of SelectionArea? #1137

Closed
erickok opened this issue Sep 6, 2022 · 4 comments · Fixed by #1176
Closed

[Investigate] Remove SelectableText in favor of SelectionArea? #1137

erickok opened this issue Sep 6, 2022 · 4 comments · Fixed by #1176
Labels
enhancement New feature or request selectable-html
Milestone

Comments

@erickok
Copy link
Collaborator

erickok commented Sep 6, 2022

We should investigate if we can simplify our support for selectable text by removing the usage of SelectableText (which has limitations and behaviour differences) in favor of simply wrapping (even even just recommending) SelectableArea SelectionArea, introduced in Flutter 3.3.

Of course the text selection needs to be as least as good (in behaviour and features) as what we have right now. It could simplify our code though and remove the need to document limitations when using SelectableHtml.

Additional context
https://api.flutter.dev/flutter/material/SelectionArea-class.html for the official doc.

@erickok erickok added the enhancement New feature or request label Sep 6, 2022
@erickok
Copy link
Collaborator Author

erickok commented Sep 6, 2022

A very quick try, wrapping the example app in SelectableArea and building to web with canvaskit, worked really well. Even table inside tables was selecting how you'd intuitively expect.

@Sub6Resources
Copy link
Owner

Sub6Resources commented Sep 7, 2022

That API definitely looks neat. I'll give it a try myself later today! I think if we can remove the burden of Selection logic from our library as much as possible, that would be best.

@asmith20002
Copy link

I've tried it briefly and it looks like it gets the job done :)

btw it is SelectionArea, not SelectableArea (the api document link is correct though)

@erickok erickok changed the title [Investigate] Remove SelectableText in favor of SelectableArea? [Investigate] Remove SelectableText in favor of SelectionArea? Sep 16, 2022
@Sub6Resources Sub6Resources added this to the 3.0.0 milestone Sep 30, 2022
@windows7lake
Copy link
Contributor

windows7lake commented Nov 28, 2022

3.0.0 is not supported with SelectionArea .
Caused by fix: Fix issue with font scaling introduced in 3.0.0-alpha.6 (#1173).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request selectable-html
Projects
None yet
4 participants