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

Button Group inside Grid renders too small #9830

Closed
stefankempf opened this issue Apr 5, 2024 · 3 comments · Fixed by #10000
Closed

Button Group inside Grid renders too small #9830

stefankempf opened this issue Apr 5, 2024 · 3 comments · Fixed by #10000
Labels

Comments

@stefankempf
Copy link

Bug description

I added a button group inside a grid fieldtype and placed it to 50% width. I also have a conditionally shown textfield in the grid row (the issue is also happening when the textfield is always shown).

Screenshot von 2024 04 05 um 21 14 21

How to reproduce

Add a grid fieldtype and place a button group with two options and a text field in it.

handle: its_me_the_button_group
            field:
              fields:
                -
                  handle: type
                  field:
                    options:
                      text: Text
                      umbruch: Umbruch
                    default: text
                    type: button_group
                    display: Typ
                    width: 50
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    replicator_preview: true
                    hide_display: false
                    validate:
                      - required
                -
                  handle: text_fragment
                  field:
                    input_type: text
                    antlers: false
                    type: text
                    display: Text-Fragment
                    width: 50
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    replicator_preview: true
                    hide_display: false
                    validate:
                      - 'required_if:{this}.type,text'
                    if:
                      type: 'equals text'
              mode: table
              reorderable: true
              fullscreen: true
              type: grid
              display: Animation
              listable: hidden
              instructions_position: above
              visibility: visible
              replicator_preview: true
              hide_display: false

Logs

No response

Environment

Statamic
Addons: 0
Antlers: runtime
Sites: 1
Version: 4.55.0 PRO

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

Runtime (default)

Additional details

No response

@duncanmcclean
Copy link
Member

Thanks! Although, this is a duplicate of #9044.

@stefankempf
Copy link
Author

Hi @duncanmcclean I'm not sure, this is a duplicate. The button group shouldn't wrap, the row inside the grid fieldtype should just be wide enough to fit both buttons, since I've set both elements to 50% width.

I can give you some more context: The td element containing the button group has a correct attribute width="50%" but its getting overwritten by the class .grid-table td.button_group-fieldtype which sets width: 1%;

No idea why this class is set, but thats where the error is coming from at least: https://github.com/statamic/cms/blob/4.x/resources/css/components/fieldtypes/button-group.css

@stefankempf
Copy link
Author

Screenshot von 2024 04 08 um 14 58 06

@duncanmcclean duncanmcclean reopened this Apr 8, 2024
@edalzell edalzell changed the title Button Group inside Grid renders to small Button Group inside Grid renders too small Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants