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.
- package/dist/emoji-picker-react.cjs.development.js +15 -18
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +15 -18
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useEmojiPreviewEvents.ts +19 -18
|
@@ -19602,25 +19602,8 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
|
|
|
19602
19602
|
if (button) {
|
|
19603
19603
|
var belowFoldByPx = detectEmojyPartiallyBelowFold(button, bodyRef);
|
|
19604
19604
|
var buttonHeight = button.getBoundingClientRect().height;
|
|
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;
|
|
19617
|
-
}
|
|
19618
19605
|
if (belowFoldByPx < buttonHeight) {
|
|
19619
|
-
button
|
|
19620
|
-
behavior: 'smooth',
|
|
19621
|
-
block: 'end'
|
|
19622
|
-
});
|
|
19623
|
-
return;
|
|
19606
|
+
return handlePartiallyVisibleElementFocus(button, setPreviewEmoji);
|
|
19624
19607
|
}
|
|
19625
19608
|
focusElement(button);
|
|
19626
19609
|
}
|
|
@@ -19634,6 +19617,20 @@ function useEmojiPreviewEvents(allow, setPreviewEmoji) {
|
|
|
19634
19617
|
};
|
|
19635
19618
|
}, [BodyRef, allow, setPreviewEmoji, isMouseDisallowed, allowMouseMove]);
|
|
19636
19619
|
}
|
|
19620
|
+
function handlePartiallyVisibleElementFocus(button, setPreviewEmoji) {
|
|
19621
|
+
var _document$activeEleme;
|
|
19622
|
+
var _allUnifiedFromEmojiE2 = allUnifiedFromEmojiElement(button),
|
|
19623
|
+
unified = _allUnifiedFromEmojiE2.unified,
|
|
19624
|
+
originalUnified = _allUnifiedFromEmojiE2.originalUnified;
|
|
19625
|
+
if (!unified || !originalUnified) {
|
|
19626
|
+
return;
|
|
19627
|
+
}
|
|
19628
|
+
(_document$activeEleme = document.activeElement) == null ? void 0 : _document$activeEleme.blur == null ? void 0 : _document$activeEleme.blur();
|
|
19629
|
+
setPreviewEmoji({
|
|
19630
|
+
unified: unified,
|
|
19631
|
+
originalUnified: originalUnified
|
|
19632
|
+
});
|
|
19633
|
+
}
|
|
19637
19634
|
|
|
19638
19635
|
var _stylesheet$create;
|
|
19639
19636
|
var FlexDirection;
|