Skip to content

ElevatedButton unable to update bgcolor property after upgrade to version >=0.24 #4119

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
1 task done
minh-wp opened this issue Oct 8, 2024 · 0 comments · Fixed by #4126
Closed
1 task done

ElevatedButton unable to update bgcolor property after upgrade to version >=0.24 #4119

minh-wp opened this issue Oct 8, 2024 · 0 comments · Fixed by #4126
Assignees
Labels
bug Something isn't working

Comments

@minh-wp
Copy link

minh-wp commented Oct 8, 2024

Duplicate Check

Describe the bug

ElevatedButton unable to update bgcolor property after upgrade to version >=0.24

Code sample

Code
[Paste your code here]

To reproduce

import flet as ft

def main(page: ft.Page):

test_button = ft.ElevatedButton(
        "Click to change color",
        icon="park_rounded",
        icon_color="green400",
        color=ft.colors.WHITE,
        bgcolor=ft.colors.BLUE_800,
    )

def on_click(e):
    if test_button.text == "red":
        test_button.text = "blue"
        test_button.bgcolor = ft.colors.BLUE_800
    else:
        test_button.text = "red"
        test_button.bgcolor = ft.colors.RED_800
    page.update()

test_button.on_click = on_click

page.add(test_button)

ft.app(main)

Expected behavior

should be able to change background color

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 11

Flet version

0.24

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

ndonkoHenri added a commit that referenced this issue Oct 8, 2024
@ndonkoHenri ndonkoHenri moved this from 🆕 New to 👀 In review in Flet Development Oct 8, 2024
@ndonkoHenri ndonkoHenri linked a pull request Oct 8, 2024 that will close this issue
11 tasks
@ndonkoHenri ndonkoHenri added the bug Something isn't working label Oct 8, 2024
ndonkoHenri added a commit that referenced this issue Oct 10, 2024
…simplify style initialization and assignment"

This reverts commit b9a7351.
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Oct 17, 2024
FeodorFitsner pushed a commit that referenced this issue Oct 17, 2024
* Update elevated_button.dart

if filled=true create FilledButton

* fixed color for disabled FilledButton

* fixed color for disabled FilledTonalButton

* Update elevated_button.dart

refactor

* Update elevated_button.dart

* define _get_control_name for FilledButton and FilledTonalButton

* fix #4119: Refactor `ElevatedButton.before_update` method to simplify style initialization and assignment

* Revert "fix #4119: Refactor `ElevatedButton.before_update` method to simplify style initialization and assignment"

This reverts commit b9a7351.

---------

Co-authored-by: ndonkoHenri <[email protected]>
Co-authored-by: TheEthicalBoy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
5 participants