Skip to content

Commit

Permalink
[FIX] Message Actions menu does not close upon choosing an action (#2…
Browse files Browse the repository at this point in the history
…7328)

Co-authored-by: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com>
Co-authored-by: Hugo Costa <20212776+hugocostadev@users.noreply.github.com>
  • Loading branch information
3 people authored and ggazzo committed Dec 16, 2022
1 parent 53b5012 commit f4ad966
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Expand Up @@ -35,7 +35,10 @@ export const MessageActionMenu: FC<{
<MessageToolboxItem
ref={ref}
icon='kebab'
onClick={(): void => setVisible(!visible)}
onClick={(e): void => {
e.stopPropagation();
setVisible(!visible);
}}
data-qa-id='menu'
data-qa-type='message-action-menu'
title={t('More')}
Expand Down
Expand Up @@ -48,10 +48,7 @@ export const Toolbox: FC<{ message: IMessage }> = ({ message }) => {
<MessageToolbox>
{messageActions.map((action) => (
<MessageToolboxItem
onClick={(e): void => {
e.stopPropagation();
action.action(e, { message, tabbar: toolbox, room });
}}
onClick={(e): void => action.action(e, { message, tabbar: toolbox, room })}
key={action.id}
icon={action.icon}
title={t(action.label)}
Expand All @@ -63,10 +60,7 @@ export const Toolbox: FC<{ message: IMessage }> = ({ message }) => {
<MessageActionMenu
options={menuActions.map((action) => ({
...action,
action: (e): void => {
e.stopPropagation();
action.action(e, { message, tabbar: toolbox, room });
},
action: (e): void => action.action(e, { message, tabbar: toolbox, room }),
}))}
data-qa-type='message-action-menu-options'
/>
Expand Down

0 comments on commit f4ad966

Please sign in to comment.