fix: import EmojiBoard directly in ProfileStatus to fix emoji selection
CI / Build & Quality Checks (push) Successful in 10m18s
CI / Build & Quality Checks (push) Successful in 10m18s
React.lazy + Suspense interacted badly with the nested FocusTraps (the settings Modal500 outer trap and EmojiBoard's inner trap). During the suspend/resolve cycle targetFromEvent returned undefined, causing handleGroupItemClick to bail before calling onEmojiSelect. Switched to a direct import matching MessageEditor and PowersEditor which both use EmojiBoard inside settings panels without lazy loading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import React, {
|
import React, {
|
||||||
ChangeEventHandler,
|
ChangeEventHandler,
|
||||||
FormEventHandler,
|
FormEventHandler,
|
||||||
Suspense,
|
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
@@ -47,10 +46,7 @@ import { createUploadAtom, UploadSuccess } from '../../../state/upload';
|
|||||||
import { CompactUploadCardRenderer } from '../../../components/upload-card';
|
import { CompactUploadCardRenderer } from '../../../components/upload-card';
|
||||||
import { useCapabilities } from '../../../hooks/useCapabilities';
|
import { useCapabilities } from '../../../hooks/useCapabilities';
|
||||||
import { useUserPresence } from '../../../hooks/useUserPresence';
|
import { useUserPresence } from '../../../hooks/useUserPresence';
|
||||||
|
import { EmojiBoard } from '../../../components/emoji-board';
|
||||||
const EmojiBoard = React.lazy(() =>
|
|
||||||
import('../../../components/emoji-board').then((m) => ({ default: m.EmojiBoard })),
|
|
||||||
);
|
|
||||||
|
|
||||||
type ProfileProps = {
|
type ProfileProps = {
|
||||||
profile: UserProfile;
|
profile: UserProfile;
|
||||||
@@ -457,14 +453,12 @@ function ProfileStatus() {
|
|||||||
position="Top"
|
position="Top"
|
||||||
align="End"
|
align="End"
|
||||||
content={
|
content={
|
||||||
<Suspense fallback={<Spinner size="100" />}>
|
<EmojiBoard
|
||||||
<EmojiBoard
|
imagePackRooms={[]}
|
||||||
imagePackRooms={[]}
|
returnFocusOnDeactivate={false}
|
||||||
returnFocusOnDeactivate={false}
|
onEmojiSelect={handleEmojiSelect}
|
||||||
onEmojiSelect={handleEmojiSelect}
|
requestClose={() => setEmojiAnchor(undefined)}
|
||||||
requestClose={() => setEmojiAnchor(undefined)}
|
/>
|
||||||
/>
|
|
||||||
</Suspense>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|||||||
Reference in New Issue
Block a user