-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
Labels
Description
It seems to me that the freshly introduced input_task_button
doesn't work with shiny modules.
The following code:
from shiny import App, module, reactive, render, ui
@module.ui
def button_ui():
return ui.p(
# ui.input_task_button("btn", label="Click me!"),
ui.input_action_button("btn", label="Click me!"),
ui.output_text("text_counter"),
)
@module.server
def button_server(input, output, session):
counter = reactive.Value(0)
@render.text
def text_counter():
return f"Button clicked {counter()} times"
@reactive.effect
@reactive.event(input.btn)
def increment_counter():
counter.set(counter() + 1)
app_ui = ui.page_fluid(
button_ui("button")
)
def server(input, output, session):
button_server("button")
app = App(app_ui, server)
Work with ui.input_action_button
it works, but with ui.input_task_button
I get the following message in the terminal:
INFO: connection open
_send_error_response: The string 'button-btn' is not a valid id; only letters, numbers, and underscore are permitted
INFO: connection closed
Am I write, or the input_task_button
should be used in a different way?
shiny == 0.7.0
, python == 3.10.13