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

Material text interactive selection uses buttonTheme #37550

Open
miguelpruivo opened this issue Aug 3, 2019 · 8 comments
Open

Material text interactive selection uses buttonTheme #37550

miguelpruivo opened this issue Aug 3, 2019 · 8 comments
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@miguelpruivo
Copy link

The Material interactive selection shouldn't use the buttonTheme or, at least, the theme should provide a flag to either use it in the interactive selection or not.

As it is, it's impossible to either use a custom buttonTheme (such setting minWidth, height and so on) without directly affecting the interactive selection that should stick with the native look & feel.

Plus, a good alternative might be having a interactiveSelectionTheme that would allow customize only it.

 Flutter (Channel unknown, v1.8.0, on Mac OS X 10.14.6 18G87, locale pt-PT)
    • Flutter version 1.8.0 at /Users/miguelruivo/DevTools/flutter
    • Framework revision 2fefa8c731 (5 weeks ago), 2019-07-01 11:33:22 -0700
    • Engine revision 45b66b722e
    • Dart version 2.4.0
@HansMuller HansMuller added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 5, 2019
@HansMuller
Copy link
Contributor

What material library component[s] are you referring to - "interactive selection"?

@HansMuller HansMuller added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 5, 2019
@miguelpruivo
Copy link
Author

@HansMuller I don’t know which is the correct name for the text selection options that appear (copy, cut, paste), so I thought it could be explicit enough, sorry. 😅

Anyway, if you customize your buttonTheme and set, let’s say, a minWidth and with a circular shape, because you want your app RaisedButtons to match that style, you’ll also directly affect the cut, copy, paste option buttons from the text selection.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 5, 2019
@HansMuller
Copy link
Contributor

OK, I think I understand what you're after. The material TextField builds a TextSelectionControls instance that ends up in the app's overlay. So it only really inherits from the app's theme. That means a definition of ButtonTheme in the TextField's context will not apply to the text field menu. And it means that a global ButtonTheme, one that's defined as part of the overall Theme, will apply to text select controls too; even if that's not what you want.

There are a couple of ways around this:

  • We could automatically wrap the text selection controls in copies of the "in context" themes.
  • We could provide a ButtonThemeData valued ThemeData property for text selection controls.
  • We could make it possible to build you own text selection controls and/or wrap the default ones.

@miguelpruivo
Copy link
Author

@HansMuller what if you don't have any "in context" theme? Will it use the global theme?

For simplicity sake and also, to make it more customizable, I personally would like to see your second point: a property -- which can be inside the ButtonTheme -- that could allow styling the TextSelectionControls which, as of now, seems pretty unclear on how to achieve so.

@renanyoy
Copy link

renanyoy commented Feb 2, 2020

also it's only for android, iOS use the system ones
which is better than using main app button theme

@miguelpruivo
Copy link
Author

@renanyoy I'm afraid not. They both share theme widgets, if you set the text font scale on iOS device settings to max it will also overflow the interactive selection box.

@renanyoy
Copy link

renanyoy commented Feb 2, 2020

no. for me I have white on black bubble, really system ones on iOS, nothing like the ones on android..
I have setup my button with stadium border as default theme.. and my main colors are blue or orange depending of the user rights, no white or black in the theme. and I have stadium cut/paste/select buttons on android and system ones iOS.

@PsyOhm23
Copy link

PsyOhm23 commented Jun 2, 2020

The scale issue on iOS is already fixed here #54140
For the current issue, text select controls doesn't uses the ButtonThemeData for iOS unlike Android.
I think adding a custom theme for text selection would be nice.
I have a ButtonThemeData with a minWidth setted to 300 which make text select controls too big.

@TahaTesser TahaTesser added P3 Issues that are less important to the Flutter project c: proposal A detailed proposal for a change to Flutter labels Jun 5, 2020
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

6 participants