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

compose: Shrink "send" button to match content-input height, like before M3 #399

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

chrisbobbe
Copy link
Collaborator

The way to get the smaller IconButton height we want has changed. After migrating to Material Design 3, in #380, we have to do this different thing.

Fixes: #398

@chrisbobbe
Copy link
Collaborator Author

Before After

…ore M3

The way to get the smaller IconButton height we want has changed.
After migrating to Material Design 3, in zulip#380, we have to do this
different thing.

Fixes: zulip#398
@gnprice
Copy link
Member

gnprice commented Nov 21, 2023

Thanks for the fix!

Merging, after adjusting the comment to be more definitive:

         style: const ButtonStyle(
-          // Match the height of the content input. Empirically, setting
-          // [MaterialTapTargetSize.shrinkWrap] seems necessary to let the size
-          // be smaller than 48px square (at least without messing with
-          // [visualDensity]). So do that. It would be nice if the touch target
-          // extended invisibly out from the button, to make a 48px square,
-          // but I can't easily check that in the inspector. It might be the
-          // behavior, from reading docs, but the docs aren't clear enough
-          // to rely on.
+          // Match the height of the content input.
           minimumSize: MaterialStatePropertyAll(Size.square(_sendButtonSize)),
+          // With the default of [MaterialTapTargetSize.padded], not just the
+          // tap target but the visual button would get padded to 48px square.
+          // It would be nice if the tap target extended invisibly out from the
+          // button, to make a 48px square, but that's not the behavior we get.
           tapTargetSize: MaterialTapTargetSize.shrinkWrap,

@gnprice gnprice force-pushed the pr-shrink-send-button-after-m3 branch from b47873f to c0a1064 Compare November 21, 2023 00:45
@gnprice gnprice merged commit c0a1064 into zulip:main Nov 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compose: Send button got larger than content-input height in Material 3 migration
2 participants