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

Text is not selectable by default on the web #32246

Closed
martinrybak opened this issue Mar 13, 2019 · 15 comments
Closed

Text is not selectable by default on the web #32246

martinrybak opened this issue Mar 13, 2019 · 15 comments
Labels
a: fidelity Matching the OEM platforms better platform-web Web applications specifically

Comments

@martinrybak
Copy link

Describe the bug
Text cannot be selected for copying. This affects all text elements other than text fields.

To Reproduce

  1. Run the /examples/gallery app
  2. Navigate to http://localhost:8080/#/material/text
  3. Attempt to highlight and select text.

Expected behavior
Text should be selectable and can be copied to the clipboard.

Screenshots
Screen Shot 2019-03-13 at 4 56 32 PM

Desktop (please complete the following information):

  • OS: mac
  • Browser chrome 72.0.3626.121, safari 12.0.3
  • Dart Version 2.2.1
  • Flutter Web commit SHA f2006dd26c71fe7e9e7e144abbd3add40b4915f9
@kevmoo kevmoo transferred this issue from another repository May 7, 2019
@kevmoo kevmoo added the platform-web Web applications specifically label May 7, 2019
@dnfield
Copy link
Contributor

dnfield commented May 8, 2019

See also #5422 - would the framework fix in progress for this be a fix for web? Or is the expectation in web that all text be selectable?

@MaxBittker
Copy link
Contributor

the expectation in web is strongly that all text is selectable, unless the property user-select: none; has been set

@yjbanov yjbanov added the a: fidelity Matching the OEM platforms better label May 23, 2019
@yjbanov yjbanov added this to the Goals milestone May 23, 2019
@lubritto
Copy link
Contributor

Any update here? We have 7 months since the last post, just an update can help us.

@dnfield
Copy link
Contributor

dnfield commented Oct 25, 2019

@yjbanov @mdebbar - is this something that should behave differently for web? This has a fix on the framework side but there Text is not selectable by default.

/cc @ferhatb

@dnfield dnfield changed the title Text is not selectable Text is not selectable by default Oct 25, 2019
@dnfield dnfield changed the title Text is not selectable by default Text is not selectable by default on the web Oct 25, 2019
@mdebbar
Copy link
Contributor

mdebbar commented Oct 25, 2019

@dnfield @lubritto In Flutter, text isn't selectable by default. Try using SelectableText to enable selection of text. Please let us know if you face any issues.

@mdebbar mdebbar closed this as completed Oct 25, 2019
@ferhatb
Copy link
Contributor

ferhatb commented Oct 25, 2019

Hi Dan, are you suggesting adding an api (maybe theme level) that will allow changing the default ?I'm fine with the consistency (default off everywhere). I think web's default makes sense on content heavy sites/docs rather than apps.

@atebitftw
Copy link

@dnfield @lubritto In Flutter, text isn't selectable by default. Try using SelectableText to enable selection of text. Please let us know if you face any issues.

With respect @mdebbar, this answer isn't satisfactory. SelectableText doesn't behave as expected in a Web context. Users expect to be able to use ctrl+c or right click on the selected text with their mouse and see "copy" in the context menu. None of this appears to be the case with SelectableText, at least on the beta channel.

@azol
Copy link

azol commented Dec 17, 2019

No way to copy text using SelectableText on dev channel. As for me the issue should be reopened. Web without ability to select/copy is... not what I expect from the web :)

@dnfield
Copy link
Contributor

dnfield commented Dec 17, 2019

@azol that sounds like a seperate issue - please file one for that (SelectableText can't be copied on web).

@mdebbar
Copy link
Contributor

mdebbar commented Dec 17, 2019

@azol @prujohn the issue you are describing is valid, and I can confirm that it isn't fixed on web. Like @dnfield said, it's a separate issue from the closed one.

I created a separate issue for the inability to copy selected text: #47234

@rayliverified
Copy link

Inadvertent content and web scraping protection is the best :D
Only copyright infringers and criminals need to copy text! /s

@MaxBittker
Copy link
Contributor

MaxBittker commented Dec 27, 2019

I understand and respect why keeping behavior consistent with other parts of flutter is desirable, but I also think there might be a better compromise to be struck here -

If you go to twitter.com, nytimes.com, github.com, etc, 95+% of text is selectable.

Breaking this assumption will cause some negative emotional reactions towards flutter web apps from users and developers, and that it's worth reconsidering the intended behavior here. Text behavior is a common smell test for "is this a native web experience?".

Even if this behavior stands for the time being, do you think another solution, such as using the Theme to store whether text is selectable by default, could be considered in the future?

@Nash0x7E2 Nash0x7E2 mentioned this issue Jan 18, 2020
11 tasks
@polina-c
Copy link
Contributor

@dnfield @lubritto In Flutter, text isn't selectable by default. Try using SelectableText to enable selection of text. Please let us know if you face any issues.

SelectableText does not help, because it makes the text selectable only within one widget.
Web users expect the text to be selectable across many elements, for example, i selected and copied this text from the previous post:


Nash0x7E2 mentioned this issue on Jan 18
Copy support on web #49117
Closed
7 of 11 tasks complete

@delCatta
Copy link

delCatta commented Apr 6, 2020

Any updates on this?

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better platform-web Web applications specifically
Projects
None yet
Development

No branches or pull requests