Skip to content

Commit

Permalink
feat: reset scroll of preview layout whenever layout changes
Browse files Browse the repository at this point in the history
  • Loading branch information
karrui committed Jul 19, 2024
1 parent e57b63b commit ab6ceb7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ export const PreviewLayout = (): JSX.Element => {
</Text>
</Flex>
)}
<Box bg="white" overflow="auto" height="100%">
<Box
bg="white"
overflow="auto"
height="100%"
// Key used to reset the scroll to the top whenever layout changes
key={currentLayout}
>
<Preview {...layoutPreviewJson} />
</Box>
</Box>
Expand Down

0 comments on commit ab6ceb7

Please sign in to comment.