Skip to content

rx.button color disapper when page reload  #140

@AManTw

Description

@AManTw

[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",
    )
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions