Skip to content

Commit 7eb8913

Browse files
committed
fix(*):Delegate the click to action buttons container
1 parent 4165ba7 commit 7eb8913

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/chat/chat-message.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ export default class IgcChatMessageComponent extends LitElement {
102102
}
103103

104104
private _handleMessageActionClick(event: PointerEvent): void {
105-
const reaction = (event.target as HTMLElement).getAttribute('name');
105+
const targetButton = event.target as HTMLElement;
106+
const button = targetButton.closest('igc-icon-button');
107+
if (!button) return;
108+
109+
const reaction = button.getAttribute('name');
106110
this._chatState?.emitEvent('igcMessageReact', {
107111
detail: { message: this.message, reaction },
108112
});

0 commit comments

Comments
 (0)