Skip to content

Commit

Permalink
fix(chat): added emoji tooltip and enter key in smiley panel
Browse files Browse the repository at this point in the history
  • Loading branch information
ilaydadastan authored and damencho committed Apr 3, 2024
1 parent 4e50546 commit 38be09f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions react/features/chat/components/web/SmileysPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { PureComponent } from 'react';
import Emoji from 'react-emoji-render';

import Tooltip from '../../../base/tooltip/components/Tooltip';
import { smileys } from '../../smileys';

/**
Expand Down Expand Up @@ -60,7 +61,7 @@ class SmileysPanel extends PureComponent<IProps> {
* @returns {void}
*/
_onKeyPress(e: React.KeyboardEvent<HTMLDivElement>) {
if (e.key === ' ') {
if (e.key === ' ' || e.key === 'Enter') {
e.preventDefault(); // @ts-ignore
this.props.onSmileySelect(e.target.id && smileys[e.target.id]);
}
Expand Down Expand Up @@ -95,9 +96,11 @@ class SmileysPanel extends PureComponent<IProps> {
onKeyPress = { this._onKeyPress }
role = 'option'
tabIndex = { 0 }>
<Emoji
onlyEmojiClassName = 'smiley'
text = { smileys[smileyKey as keyof typeof smileys] } />
<Tooltip content = { smileys[smileyKey as keyof typeof smileys] }>
<Emoji
onlyEmojiClassName = 'smiley'
text = { smileys[smileyKey as keyof typeof smileys] } />
</Tooltip>
</div>
));

Expand Down

0 comments on commit 38be09f

Please sign in to comment.