Skip to content

Commit 7f17963

Browse files
authored
fix: Replace the root components order (#1026)
### Fix * Replace the root components order because dropdown menu is hided by modals
1 parent 30d146c commit 7f17963

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/lib/Sendbird.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import useOnlineStatus from './hooks/useOnlineStatus';
2222
import useConnect from './hooks/useConnect';
2323
import { LoggerFactory, LogLevel } from './Logger';
2424
import pubSubFactory from './pubSub/index';
25-
import useAppendDomNode from '../hooks/useAppendDomNode';
2625

2726
import { VoiceMessageProvider } from './VoiceMessageProvider';
2827
import { LocalizationProvider } from './LocalizationContext';
@@ -48,12 +47,13 @@ import {
4847
CustomExtensionParams,
4948
SBUEventHandlers, SendbirdProviderUtils,
5049
} from './types';
51-
import { GlobalModalProvider } from '../hooks/useModal';
50+
import { GlobalModalProvider, ModalRoot } from '../hooks/useModal';
5251
import { RenderUserProfileProps } from '../types';
5352
import PUBSUB_TOPICS, { SBUGlobalPubSub, SBUGlobalPubSubTopicPayloadUnion } from './pubSub/topics';
5453
import { EmojiManager } from './emojiManager';
5554
import { uikitConfigStorage } from './utils/uikitConfigStorage';
5655
import useMessageTemplateUtils from './hooks/useMessageTemplateUtils';
56+
import { EmojiReactionListRoot, MenuRoot } from '../ui/ContextMenu';
5757

5858
export { useSendbirdStateContext } from '../hooks/useSendbirdStateContext';
5959

@@ -257,12 +257,6 @@ const SendbirdSDK = ({
257257
setLogger(LoggerFactory(logLevel as LogLevel));
258258
}, [logLevel]);
259259

260-
useAppendDomNode([
261-
'sendbird-modal-root',
262-
'sendbird-dropdown-portal',
263-
'sendbird-emoji-list-portal',
264-
], 'body');
265-
266260
// should move to reducer
267261
const [currentTheme, setCurrentTheme] = useState(theme);
268262
useEffect(() => {
@@ -429,6 +423,10 @@ const SendbirdSDK = ({
429423
</VoiceMessageProvider>
430424
</LocalizationProvider>
431425
</MediaQueryProvider>
426+
{/* Roots */}
427+
<EmojiReactionListRoot />
428+
<ModalRoot />
429+
<MenuRoot />
432430
</SendbirdSdkContext.Provider>
433431
);
434432
};

0 commit comments

Comments
 (0)