diff --git a/src/svelte/components/Message.svelte b/src/svelte/components/Message.svelte index 5beaf9a9..18c6abc9 100644 --- a/src/svelte/components/Message.svelte +++ b/src/svelte/components/Message.svelte @@ -24,6 +24,8 @@ export let textFooter = ''; export let avatar = undefined; + export let onClick = undefined; + const rippleEl = { current: null }; const dark = useDarkClasses(); @@ -53,6 +55,7 @@ {id} bind:this={rippleEl.current} class={classes} + on:click={onClick} {...$$restProps} > {#if avatar || $$slots.avatar} diff --git a/src/types/Message.d.ts b/src/types/Message.d.ts index 308bde05..c57865b1 100644 --- a/src/types/Message.d.ts +++ b/src/types/Message.d.ts @@ -80,4 +80,9 @@ interface Props { * Message user's avatar URL */ avatar?: string | React.ReactNode; + + /** + * Message click handler + */ + onClick?: (e: any) => void; }