Skip to content

v1: ElevatedButton's style property is ignored in some cases #5538

@michep

Description

@michep

Duplicate Check

Describe the bug

v1: ElevatedButton's style property seems to be ignored iin some cases

Code sample

Code
import flet as ft


def main(page: ft.Page):
    counter = ft.Text("0", size=50, data=0)

    def increment_click(e):
        counter.data += 1
        counter.value = str(counter.data)
        counter.update()

    page.floating_action_button = ft.ElevatedButton(
        content=ft.Text('Add'),
        # bgcolor=ft.Colors.RED, # UNCOMMENT
        style=ft.ButtonStyle(
            shape=ft.RoundedRectangleBorder(
                radius=4,
            ),
        ),
        on_click=increment_click,
    )
    page.add(
        ft.SafeArea(
            expand=True,
            content=ft.Container(
                content=counter,
                alignment=ft.Alignment.CENTER,
            ),
        )
    )

ft.run(main)

To reproduce

Run sample code - button will have border radius != 4

BUT!

If you uncomment line

# bgcolor=ft.Colors.RED, # UNCOMMENT

then button border radius will be 4 as expected

Expected behavior

ElevatedButton border radius should be as specified in style property

Screenshots / Videos

No response

Operating System

Windows

Operating system details

Windows 11

Flet version

0.70.0.dev5367

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

No response

Additional details

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions