You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no existing capabilities for running a JS script from within an event tag.
Additionally, string based events serialized from html_to_vdom currently do not execute at all.
Proposed Actions
Allow events to be declared as string type. If the event is a string, pass it directly into React's prop dictionary, which will allow it to execute as traditional javascript.
@componentdefmy_component():
returnhtml.button(
{ "onClick": "$('.sidebar').toggle()" },
"This is a button!",
)
In this scenario, providing a str within onClick would execute the event string the client side.
The text was updated successfully, but these errors were encountered:
Archmonger
changed the title
Support executing javascript within events by declaring them as string type
Support for string events (to execute raw javascript)
Jan 28, 2025
Current Situation
There's currently no existing capabilities for running a JS script from within an event tag.
Additionally, string based events serialized from
html_to_vdom
currently do not execute at all.Proposed Actions
Allow events to be declared as string type. If the event is a string, pass it directly into React's prop dictionary, which will allow it to execute as traditional javascript.
In this scenario, providing a
str
withinonClick
would execute the event string the client side.Originally posted by @Archmonger in #783
The text was updated successfully, but these errors were encountered: