7 ms·
Flutter team member here. In Flutter, the developer consciously decides which text should be selectable (and thus copy/paste'able), so while it's true that tex
by tvolkert 6y ago
Flutter team member here. In Flutter, the developer consciously decides which text should be selectable (and thus copy/paste'able), so while it's true that text is not inherently selectable in a Flutter app, text that the app developer decided to make selectable will be.
- selykg 6y agoThis sounds awful. Like some sort of bullshit DRM in a way. Now I'm thinking of all the ways I could get screwed here. * Not being able to copy transactions from my bank account * Not being able to easily send text to a read-later service (not sure if this necessarily depends on selectable text, but who knows, maybe selectable means the text isn't visible to these services now) * Not being able to easily copy something that needs entering into another page This reminds of sites that try really hard to NOT allow password managers, or even allowing pasting of text into form fields. Pass.
- fastball 6y agoYou know devs can already make text not selectable on the web, right?
- selykg 6y agoWas not aware of that, thanks for letting me know. In either case, it's a dick move and shouldn't be encouraged.
- catmanjan 6y agoFlutter should pick sensible defaults, in this case most agree that text should be selectable
- capableweb 6y agoFlutter: defaults to unselectable Web: defaults to selectable Flutter on Web: defaults to Flutter, not Web
- deleted 6y ago[deleted]
- SamBam 6y agoIt takes work to make it non-selectable. In Flutter, it defaults to non-selectable. Most of the time a dev isn't thinking "I'd better make this selectable," because they simply aren't going to think of all the reasons someone might select text. They'll think of the obvious-to-them cases, and leave all the other text as unselectable.
- Hixie 6y agoIt doesn't really default to anything. There's a widget for selectable text and a widget for non-selectable text.
- CGamesPlay 6y agoOK, but the Flutter gallery has zero selectable text, as far as I can see. Seems like a great case of where developer decided "doesn't need selection, let's let the user drag to scroll with their mouse instead".
- unityByFreedom 6y agoWhy even make it a 50/50 choice? I hate apps without selectable text and they're everywhere. Translating something becomes a nightmare and that hurts useability. It's like if you made spoiler 50/50. Do you want to see this without clicking? I think we really overlook the thought that had gone into making js, and other open tech.
- SamBam 6y agoExactly. And I didn't even realize how often I subconsciously select text while I read until I saw the relevant xkcd. [1] I truly think my random clicking on paragraphs that I'm approaching isn't just ADHD but a way of helping my eyes stay on track. It's very disconcerting when the text doesn't select. (As, clearly, all these comments noticed as well -- why were we all trying to select the text? To check if it's Flash-ish, of course, but also we just like things to grab onto while we read.) 1. https://xkcd.com/1271/ https://xkcd.com/1271/
- kroltan 6y agoYes but on the web you can use a user-agent that doesn't care about what the site says should be selectable, or at least an extension that overrides the CSS in question.
- shawnz 6y agoI'm not happy about "user-select" not having an easy override. But at least it can be overridden by a user CSS file or a browser extension, which isn't so bad. This is much worse.
- monkeybutton 6y agoI use the select text -> web search feature in Chrome all the time to quickly look up definitions of words. Breaking this will be really annoying to anyone reading webpages in a 2nd language than their own.
- lrem 6y agoWhen was the last time you tried to copy the text of the menu items of whatever native app you're using? Or the tab title?
- greatwhitenorth 6y agoWhy can't the default be always selectable? Let the developer choose which ones they don't want to be selectable. Also, what is the use case for non selectable behavior?
- LocalPCGuy 6y agoIn the context of the web, this seems like it should be a non-starter. Why should the developer be able to tell the user what can and cannot be selected?
- fastball 6y agoUm. You can do this in HTML/CSS too.
- themacguffinman 6y agoThey already can, CSS has a property called "user-select" that can be set to "none". It's pretty common to disable user selection on label text that isn't expected to be copied.
- mkl 6y agoThis is annoying, but is at least trivial to get around with browser debugging tools. The web developer is not the person whose expectations matter. Selecting label text is almost essential for being to explain to someone else how to do things, or communicate about the interface with the site developer.
- themacguffinman 6y agoDepends on the label, it's not essential for plenty of things. I don't, for example, need to copy "Cancel" in my browser before I am capable of talking about the cancel button in the UI. You're right, user expectations are what matter, and users do not expect most buttons and controls to be text-selectable. It was never an expectation in native apps while users find it frustrating when control labels unexpectedly seep into blocks of text they are dragging to select. Most users don't open devtools to workaround this (Safari doesn't even enable devtools by default). While it's annoying when developers get it wrong (put "user-select: none" on things that should be selectable), this changes very little for the vast majority of web users.
- michaelmrose 6y agoAs a user I don't want the developer to need to anticipate which text ought to be selectable as they will inevitably fail to consider some use cases it ought to be the default.
- deleted 6y ago[deleted]
- mdoms 6y agoQuestion for the flutter devs - have you ever used The Internet?
- fastball 6y agoHave you? https://developer.mozilla.org/en-US/docs/Web/CSS/user-select https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
- mdoms 6y agoYes I have, which is why I know text can be selected by default in every web environment.
- fastball 6y agoThere is no default in Flutter. Everything is a widget that you have to deliberately choose. https://api.flutter.dev/flutter/material/SelectableText-class.html https://api.flutter.dev/flutter/material/SelectableText-clas...
- jkrems 6y agoIf `Text` and `SelectableText` exist, I would call that an opt-in. The default is "Text" (not selectable) and a modifier can be applied to opt into using "SelectableText". It would be different if they were called "UnselectableText" and "SelectableText".
- drusepth 6y agoIsn't that just semantics? Seems like every dev using Flutter for more than a few days would know that both `Text` and `SelectableText` exist and pick the one that's relevant to whatever kind of text they're adding. At that point, it's the dev's fault for making a conscious decision to make text selectable or not (if they choose wrong); not really the language's.
- wffurr 6y agoI get that user-select was already a thing in CSS, but why is so much of the text in the demos at https://gallery.flutter.dev/ https://gallery.flutter.dev/ not-selectable? It's a real bad look.
- cure 6y agoOh boy, that is a spectacularly bad idea. Not only is this making it easy for app developers to do the wrong thing ("I will just put some text here and make it unselectable, that is going to be great UX") but even worse, it is the default? There are going to be some unintended consequences here, I suspect. This reminds me of those websites that use javascript to preventing pasting into password fields "because security", thus breaking everyone's password managers, and making everyone less secure in the process ("if I have to type in that password every time, I'd better choose something simple I can remember..."). So, what about accessibility? If the text is not accessible, how are screen readers going to work?Vision impaired people are just going to have to ... do what, exactly? Will they have to apply OCR to access the content of a Flutter app? This really reminds me of what was so sucky about Flash. I guess we'll get lots of little walled gardens that make basic interaction via text deliberately difficult. This feels like the opposite of the open web.
- onli 6y agoCome on. Isn't this only happening because the initial text widget did not have text selection, the one with text selection came later and now we are in this bad situation? Just enable text selection for both/all text widgets when targeting the web. You could couple that with a major version increase... This feedback you get here will only get worse with time, and it will block adoption.
- tofuahdude 6y agoWow, that is a remarkably terrible default behavior. Virtually all other platforms behave in the opposite manner. If the goal of the environment is to provide a new standard for cross-platform development, your default behaviors are extremely important decisions.
- jkrems 6y agoIs the goal to get full parity with native text selection? I went to the plasma demo and tried to double/triple click on text and it didn't match what text selection is supposed to do, at least on macOS. Which makes it a bit jarring. Right now it seems to be a bit "uncanny valley". (Disclaimer: I work for Google but not related to Flutter.)
- vendiddy 6y agoI think the selection some improvement improvements needed reach a native-feel. For example, interactions like triple-click to select a line. However I think the decision to make text selection opt-in makes sense from the context of an application that targets web. For example, if you open up your mail app or Slack, you will find that a lot of text on the screen isn't selectable. For example, you can't select the text of the tabs on your browser. If all text was selectable by default for an app, it may cause unexpected results rather than having the develop opt-in to deciding what is selectable. We have many widgets in our app that we wouldn't want selectable for UX reasons. In practice, it hasn't been much effort for us to make things selectable. Just need to replace a Text widget with a SelectableText widget.