Skip to content

Commit

Permalink
fix: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sangar-1028 committed Dec 6, 2023
1 parent 8405c18 commit b9ac193
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ function EmojiPickerMenu(props) {
}
const emoji = lodashGet(item, ['types', preferredSkinTone], item.code);
onEmojiSelected(emoji, item);
// On web, avoid this Enter default input action; otherwise, it will add a new line in the subsequently focused composer.
keyBoardEvent.preventDefault();
// On mWeb, avoid propagating this Enter keystroke to Pressable child component; otherwise, it will trigger the onEmojiSelected callback again.
keyBoardEvent.stopPropagation();
return;
}
Expand Down

0 comments on commit b9ac193

Please sign in to comment.