Skip to content

Commit

Permalink
fix double mount/unmount in ui-tray
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshaf authored Oct 11, 2023
1 parent 9f3e0f5 commit f432c6d
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions packages/ui-tray/src/Tray/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,21 @@ class Tray extends Component<TrayProps> {
css={this.props.styles?.tray}
ref={contentRef}
>
{this.state.transitioning ? (
children
) : (
<Dialog
as="div"
label={label}
defaultFocusElement={defaultFocusElement}
open
shouldContainFocus={shouldContainFocus}
shouldReturnFocus={shouldReturnFocus}
shouldCloseOnDocumentClick={shouldCloseOnDocumentClick}
shouldCloseOnEscape
liveRegion={liveRegion}
onDismiss={onDismiss}
role={role}
>
<div css={this.props.styles?.content}>{children}</div>
</Dialog>
)}
<Dialog
as="div"
label={label}
defaultFocusElement={defaultFocusElement}
open
shouldContainFocus={shouldContainFocus}
shouldReturnFocus={shouldReturnFocus}
shouldCloseOnDocumentClick={shouldCloseOnDocumentClick}
shouldCloseOnEscape
liveRegion={liveRegion}
onDismiss={onDismiss}
role={role}
>
<div css={this.props.styles?.content}>{children}</div>
</Dialog>
</span>
</Transition>
)}
Expand Down

0 comments on commit f432c6d

Please sign in to comment.