-
-
Notifications
You must be signed in to change notification settings - Fork 331
Open
Description
Discussed in #1333
Originally posted by masipcat February 7, 2026
Currently it's not possible to use a partial function as EventHandlerFunction. I could use a lambda for synchronous event handlers, but it won’t work for async event handlers.
Pseudo code of what I'm doing:
@component
def ListSelector(items):
async def handle_select_list(item_id):
await do_something(item_id)
return [
html.div(
{
"key": item["id"],
"class": "list-select-option",
"onclick": partial(handle_select_list, item["id"]),
}
)
for item in items
]I'm aware that I could refactor this code in a way that I don't need to use a partial or a lambda, but anyways, I thought it'd be better if it is supported.
It just need a couple of lines to support partial functions: masipcat@837a18c
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels