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.
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.
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.