Prevent rendering safe-app outside its container while loading (#2143)

This commit is contained in:
nicolas 2021-04-13 04:22:17 -03:00 committed by GitHub
parent ee03bb6ea7
commit fbff0a35e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -59,11 +59,12 @@ const StyledCard = styled(Card)`
padding: 0;
`
const StyledIframe = styled.iframe`
const StyledIframe = styled.iframe<{ isLoading: boolean }>`
height: 100%;
width: 100%;
overflow: auto;
box-sizing: border-box;
display: ${({ isLoading }) => (isLoading ? 'none' : 'block')};
`
const Breadcrumb = styled.div`
@ -326,6 +327,7 @@ const AppFrame = ({ appUrl }: Props): React.ReactElement => {
)}
<StyledIframe
isLoading={appIsLoading}
frameBorder="0"
id={`iframe-${appUrl}`}
ref={iframeRef}