[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(ui): fix findDOMNode is deprecated warning when collapsing the to…
Browse files Browse the repository at this point in the history
…olbar (#2413)
  • Loading branch information
jikkai committed Jun 4, 2024
1 parent bdf033c commit 754fad2
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions packages/ui/src/views/components/doc-bars/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,32 @@ export function Toolbar(props: IToolbarProps) {

{collapsedId.length > 0 && (
<Tooltip title={localeService.t('more')} placement="bottom">
<Dropdown
forceRender
className={styles.toolbarMore}
overlay={(
<div className={styles.toolbarMoreContainer} onClick={(e) => e.stopPropagation()}>
{Object.entries(groupsByKey).map(([key, item]) => (
<div key={key} className={styles.toolbarGroup}>
{item.map(
(subItem) =>
collapsedId.includes(subItem.id) && (
<ToolbarItem key={subItem.id} {...subItem} />
)
)}
</div>
))}
</div>
)}
>
<ToolbarButton className={styles.toolbarItemTextButton}>
<MoreFunctionSingle />
</ToolbarButton>
</Dropdown>
<div>
<Dropdown
forceRender
className={styles.toolbarMore}
overlay={(
<div className={styles.toolbarMoreContainer} onClick={(e) => e.stopPropagation()}>
{Object.entries(groupsByKey).map(([key, item]) => (
<div key={key} className={styles.toolbarGroup}>
{item.map(
(subItem) =>
collapsedId.includes(subItem.id) && (
<ToolbarItem key={subItem.id} {...subItem} />
)
)}
</div>
))}
</div>
)}
>
<span>
<ToolbarButton className={styles.toolbarItemTextButton}>
<MoreFunctionSingle />
</ToolbarButton>
</span>
</Dropdown>
</div>
</Tooltip>
)}
</div>
Expand Down

0 comments on commit 754fad2

Please sign in to comment.