Skip to content

Filled and FilledTonal Buttons bgcolor sticks on global disable #1503

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

Closed
ndonkoHenri opened this issue Jun 19, 2023 · 0 comments · Fixed by #4090
Closed

Filled and FilledTonal Buttons bgcolor sticks on global disable #1503

ndonkoHenri opened this issue Jun 19, 2023 · 0 comments · Fixed by #4090
Assignees
Labels
bug Something isn't working controls

Comments

@ndonkoHenri
Copy link
Contributor

ndonkoHenri commented Jun 19, 2023

Code:

import flet as ft


def main(page: ft.Page):
    page.theme_mode = "light"

    page.add(
        ft.Row(
            controls=[
                ft.Column(
                    [
                        ft.FilledButton("Filled", disabled=True),   # button-specific-disable disables the button as expected and the color/bgcolor is also modified
                        ft.FilledTonalButton("Filled tonal", disabled=True),
                        ft.ElevatedButton("Elevated")
                    ],
                    disabled=True
                ),
                ft.Column(
                    [
                        ft.FilledButton("Filled"),   # setting disabled=True here will turn off the bgcolor shown
                        ft.FilledTonalButton("Filled tonal"),  # setting disabled=True here will turn off the bgcolor shown
                        ft.ElevatedButton("Elevated")
                    ],
                    disabled=True   # this disables the first two buttons but their bgcolors are not modified
                )
            ]
        )
    )


if __name__ == "__main__":
    ft.app(target=main)
  • Running this code, you will notice that the filled and filledtonal btns in the second column still have their bgcolor set, although they are disabled. To solve this, I am forced to add a specific disable=True in their object creation as seen in the first column.

image

  • The expected behavior could be observed by having a look at the elevatedbutton which is 'perfectly' disabled.

  • I remember a commit was pushed for this sticky bgcolor issue on-disable, but seems like it works 'perfectly' only when setting disabled=True at object creation and not globally.

@ndonkoHenri ndonkoHenri changed the title Filled and FilledTonal Buttons bgcolor sticks on disable Filled and FilledTonal Buttons bgcolor sticks on global disable Jun 19, 2023
@FeodorFitsner FeodorFitsner added bug Something isn't working controls labels Sep 5, 2023
@ndonkoHenri ndonkoHenri linked a pull request Oct 8, 2024 that will close this issue
11 tasks
@ndonkoHenri ndonkoHenri moved this from 🆕 New to 👀 In review in Flet Development Oct 8, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working controls
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants