emoji-picker-react 4.7.16 → 4.7.18

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,25 +19603,8 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
19603
19603
  if (button) {
19604
19604
  var belowFoldByPx = detectEmojyPartiallyBelowFold(button, bodyRef);
19605
19605
  var buttonHeight = button.getBoundingClientRect().height;
19606
- if (belowFoldByPx < buttonHeight / 2) {
19607
- var _allUnifiedFromEmojiE2 = allUnifiedFromEmojiElement(button),
19608
- unified = _allUnifiedFromEmojiE2.unified,
19609
- originalUnified = _allUnifiedFromEmojiE2.originalUnified;
19610
- if (!unified || !originalUnified) {
19611
- return;
19612
- }
19613
- setPreviewEmoji({
19614
- unified: unified,
19615
- originalUnified: originalUnified
19616
- });
19617
- return;
19618
- }
19619
19606
  if (belowFoldByPx < buttonHeight) {
19620
- button.scrollIntoView({
19621
- behavior: 'smooth',
19622
- block: 'end'
19623
- });
19624
- return;
19607
+ return handlePartiallyVisibleElementFocus(button, setPreviewEmoji);
19625
19608
  }
19626
19609
  focusElement(button);
19627
19610
  }
@@ -19635,6 +19618,20 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
19635
19618
  };
19636
19619
  }, [BodyRef, allow, setPreviewEmoji, isMouseDisallowed, allowMouseMove]);
19637
19620
  }
19621
+ function handlePartiallyVisibleElementFocus(button, setPreviewEmoji) {
19622
+ var _document$activeEleme;
19623
+ var _allUnifiedFromEmojiE2 = allUnifiedFromEmojiElement(button),
19624
+ unified = _allUnifiedFromEmojiE2.unified,
19625
+ originalUnified = _allUnifiedFromEmojiE2.originalUnified;
19626
+ if (!unified || !originalUnified) {
19627
+ return;
19628
+ }
19629
+ (_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.blur == null ? void 0 : _document$activeEleme.blur();
19630
+ setPreviewEmoji({
19631
+ unified: unified,
19632
+ originalUnified: originalUnified
19633
+ });
19634
+ }
19638
19635
 
19639
19636
  var _stylesheet$create;
19640
19637
  var FlexDirection;