Skip to content

[button group] connected button groups affect adjacent buttons #4782

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

Open
manabu-nakamura opened this issue May 18, 2025 · 0 comments · May be fixed by #4783
Open

[button group] connected button groups affect adjacent buttons #4782

manabu-nakamura opened this issue May 18, 2025 · 0 comments · May be fixed by #4783
Labels

Comments

@manabu-nakamura
Copy link
Contributor

Description: Connected button groups affect adjacent buttons.

video.mp4

Expected behavior: Connected button groups don't affect adjacent buttons.

https://m3.material.io/components/button-groups/guidelines:

Standard button groups ... When a button in a standard group is selected:

  • The selected button changes shape and width
  • A selected toggle button also changes color
  • Adjacent buttons move and temporarily change width

Connected button groups ...

They behave similarly to standard groups, except they don't affect adjacent buttons.

Source code: https://github.com/material-components/material-components-android/blob/master/docs/components/Button.md#connected-button-group:

<com.google.android.material.button.MaterialButtonGroup
    android:id="@+id/buttonGroup"
    style="@style/Widget.Material3.MaterialButtonGroup.Connected"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <Button
        style="?attr/materialButtonOutlinedStyle"
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button 1"
    />
    <Button
        style="?attr/materialButtonOutlinedStyle"
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button 2"
    />
    <Button
        style="?attr/materialButtonOutlinedStyle"
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button 3"
    />
</com.google.android.material.button.MaterialButtonGroup>

Minimal sample app repro: Test16.zip

Android API version: 34

Material Library version: 1.13.0-alpha13 and 1.14.0-alpha01

Device: Android Emulator 35.5.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant