- {group.items.map(({ item, globalIdx }) => {
- const title = typeof item.props.title === 'string' ? item.props.title : (item.props.title as any)?.value || '';
+ (() => {
+ const startOffset = rowMetrics.offsets[visibleStart] || 0;
+ const endOffset = visibleEnd < rowMetrics.offsets.length
+ ? rowMetrics.offsets[visibleEnd]
+ : rowMetrics.totalHeight;
+ const bottomSpacer = Math.max(0, rowMetrics.totalHeight - endOffset);
+ return (
+ <>
+ {startOffset > 0 &&
}
+ {emojiGridRows.slice(visibleStart, visibleEnd).map((row) => {
+ if (row.type === 'header') {
+ return (
+
+ {row.title}{row.count}
+
+ );
+ }
return (
-
setSelectedIdx(globalIdx)}
- onActivate={() => {
- if (globalIdx === selectedIdx) {
- primaryAction?.execute();
- } else {
- setSelectedIdx(globalIdx);
- }
- inputRef.current?.focus();
- }}
- onContextAction={(event: React.MouseEvent) => {
- event.preventDefault();
- event.stopPropagation();
- setSelectedIdx(globalIdx);
- setShowActions(true);
+
+ >
+ {row.items.map(({ item, globalIdx }) => {
+ const title = typeof item.props.title === 'string' ? item.props.title : (item.props.title as any)?.value || '';
+ return (
+ setSelectedIdx(globalIdx)}
+ onActivate={() => {
+ if (globalIdx === selectedIdxRef.current) {
+ primaryActionRef.current?.execute();
+ } else {
+ setSelectedIdx(globalIdx);
+ }
+ inputRef.current?.focus();
+ }}
+ onContextAction={(event: React.MouseEvent) => {
+ event.preventDefault();
+ event.stopPropagation();
+ setSelectedIdx(globalIdx);
+ setShowActions(true);
+ }}
+ />
+ );
+ })}
+