diff --git a/packages/client/src/utils/componentProps.js b/packages/client/src/utils/componentProps.js
index 161565e789..559fc54486 100644
--- a/packages/client/src/utils/componentProps.js
+++ b/packages/client/src/utils/componentProps.js
@@ -43,8 +43,8 @@ export const enrichProps = async (props, context) => {
// Enrich all data bindings in top level props
let enrichedProps = await enrichDataBindings(validProps, totalContext)
- // Enrich button actions if they exist
- if (props._component?.endsWith("/button") && enrichedProps.onClick) {
+ // Enrich click actions if they exist
+ if (enrichedProps.onClick) {
enrichedProps.onClick = enrichButtonActions(
enrichedProps.onClick,
totalContext
diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json
index 9cd8999088..93752f8082 100644
--- a/packages/standard-components/manifest.json
+++ b/packages/standard-components/manifest.json
@@ -330,6 +330,11 @@
"label": "Color",
"key": "color",
"defaultValue": "#000"
+ },
+ {
+ "type": "event",
+ "label": "On Click",
+ "key": "onClick"
}
]
},
diff --git a/packages/standard-components/src/Icon.svelte b/packages/standard-components/src/Icon.svelte
index 3ae9ffe6dd..51e4f5d50b 100644
--- a/packages/standard-components/src/Icon.svelte
+++ b/packages/standard-components/src/Icon.svelte
@@ -7,6 +7,7 @@
export let icon = ""
export let size = "fa-lg"
export let color = "#f00"
+ export let onClick
$: styles = {
...$component.styles,
@@ -17,4 +18,4 @@
}
-
+