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
It seems we need to include a class {} statement if we want to use Event handling. I have created two components, both components use buttons elements with on-click method, however, one should include a class statement so the events run. I have created the following repo to reproduce it.
static function handleClick() {
alert("Component 1 Clicked by static function!");
}
<button on-click(handleClick)>
Click static function
</button>
But the following component does work:
class {}
static function handleClick() {
alert("Component 1 Clicked by static function!");
}
<button on-click(handleClick)>
Click static function
</button>
Actual Behavior
We expected both components to work. We expected to use Event handling without a class statement.
Marko Version: @5.25.16
Details
It seems we need to include a
class {}
statement if we want to use Event handling. I have created two components, both components usebuttons
elements withon-click
method, however, one should include a class statement so the events run. I have created the following repo to reproduce it.See:
https://github.com/AndresBarreto-code/marko-components
Expected Behavior
The following component does not work:
But the following component does work:
Actual Behavior
We expected both components to work. We expected to use Event handling without a class statement.
Your Environment
Steps to Reproduce
The text was updated successfully, but these errors were encountered: