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

rx.button color disapper when page reload #140

Open
AManTw opened this issue Aug 27, 2023 · 0 comments
Open

rx.button color disapper when page reload #140

AManTw opened this issue Aug 27, 2023 · 0 comments

Comments

@AManTw
Copy link
Contributor

AManTw commented Aug 27, 2023

[Status]
the example code - 'quiz'
In 'index' class, there's a declaration of a 'box' used to place the 'Submit' button,
I've assigned a color "lightblue" to this button and add a alertdialog on it.

However,

  1. when the page is reloaded (F5), the "lightblue" is displayed briefly and then disappears
  2. returned back to this page from result page , button not display "lightblue".
    But other buttons in the alertdialog displayed color correctly.

Please let me know where I might have gone wrong?

[Code]
below is the code of index():

def index():
    """The main view."""
    return rx.center(
        rx.vstack(
            header(),
            question1(),
            question2(),
            question3(),
            rx.box(
                rx.button(
                    "Submit",
                    bg="lightblue",
                    color="black",
                    width="6em",
                    padding="1em",                    
                    on_click=State.alertdialogchange,
                ),
                rx.alert_dialog(
               #setting of alert_dialog 
                ),
            ),          
            spacing="1em",
        ),
        padding_y="2em",
        height="100vh",
        align_items="top",
        bg="#ededed",
        overflow="auto",
    )
  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant