emoji-picker-react 4.7.16 → 4.7.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19603,17 +19603,7 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
19603
19603
  var belowFoldByPx = detectEmojyPartiallyBelowFold(button, bodyRef);
19604
19604
  var buttonHeight = button.getBoundingClientRect().height;
19605
19605
  if (belowFoldByPx < buttonHeight / 2) {
19606
- var _allUnifiedFromEmojiE2 = allUnifiedFromEmojiElement(button),
19607
- unified = _allUnifiedFromEmojiE2.unified,
19608
- originalUnified = _allUnifiedFromEmojiE2.originalUnified;
19609
- if (!unified || !originalUnified) {
19610
- return;
19611
- }
19612
- setPreviewEmoji({
19613
- unified: unified,
19614
- originalUnified: originalUnified
19615
- });
19616
- return;
19606
+ return handlePartiallyVisibleElementFocus(button, setPreviewEmoji);
19617
19607
  }
19618
19608
  if (belowFoldByPx < buttonHeight) {
19619
19609
  button.scrollIntoView({
@@ -19634,6 +19624,20 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
19634
19624
  };
19635
19625
  }, [BodyRef, allow, setPreviewEmoji, isMouseDisallowed, allowMouseMove]);
19636
19626
  }
19627
+ function handlePartiallyVisibleElementFocus(button, setPreviewEmoji) {
19628
+ var _document$activeEleme;
19629
+ var _allUnifiedFromEmojiE2 = allUnifiedFromEmojiElement(button),
19630
+ unified = _allUnifiedFromEmojiE2.unified,
19631
+ originalUnified = _allUnifiedFromEmojiE2.originalUnified;
19632
+ if (!unified || !originalUnified) {
19633
+ return;
19634
+ }
19635
+ (_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.blur == null ? void 0 : _document$activeEleme.blur();
19636
+ setPreviewEmoji({
19637
+ unified: unified,
19638
+ originalUnified: originalUnified
19639
+ });
19640
+ }
19637
19641
 
19638
19642
  var _stylesheet$create;
19639
19643
  var FlexDirection;