-
-
Notifications
You must be signed in to change notification settings - Fork 904
Closed
Labels
bugType/scope: Incorrect behavior in existing functionalityType/scope: Incorrect behavior in existing functionalityreviewStatus: PR is open and needs reviewStatus: PR is open and needs review🌳 advancedDifficulty: Requires deep knowledge of the topicDifficulty: Requires deep knowledge of the topic🟡 mediumPriority: Relevant, but not essentialPriority: Relevant, but not essential
Milestone
Description
Description
I am trying to "hide" some settings in a dialog, but whenever I reopen the dialog, the initial value from page load is reset, seeming ignoring binds.
But the bind actually works correctly, the input is just displaying it wrong.
The label changes as expected when I modify the input, but the input default value (either from the element or from the storage) is "restored" every time the dialog opens.
from nicegui import ui, app
@ui.page("/")
def index():
with ui.dialog() as edit_dialog, ui.card():
text_input = ui.input("Text", value="Default").bind_value(app.storage.user, "text")
ui.button("Edit", on_click=edit_dialog.open)
ui.label().bind_text_from(text_input, "value")
ui.run(storage_secret="123")I can work around it by manually update all contained inputs when opening the dialog (before or after .open() doesn't actually matter), but that hardly seems intentional.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugType/scope: Incorrect behavior in existing functionalityType/scope: Incorrect behavior in existing functionalityreviewStatus: PR is open and needs reviewStatus: PR is open and needs review🌳 advancedDifficulty: Requires deep knowledge of the topicDifficulty: Requires deep knowledge of the topic🟡 mediumPriority: Relevant, but not essentialPriority: Relevant, but not essential