generated from mantinedev/remix-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reproducible example of portal + style rendering bug.
- Loading branch information
Showing
3 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Header, Burger, Box, Drawer } from "@mantine/core"; | ||
import { useDisclosure } from "@mantine/hooks"; | ||
|
||
export function HeaderAction() { | ||
const [opened, { toggle, close }] = useDisclosure(false); | ||
|
||
return ( | ||
<Box> | ||
<Header height={60}> | ||
<Burger opened={opened} onClick={toggle} size="sm" /> | ||
<h1 style={{ color: "white", display: "inline" }}>👈 Open here</h1> | ||
</Header> | ||
|
||
<Drawer | ||
opened={opened} | ||
onClose={close} | ||
size="100%" | ||
padding="md" | ||
title={ | ||
<h1 style={{ color: "white" }}> | ||
❎ will be 👉 during dev mode and 👇 during build | ||
</h1> | ||
} | ||
zIndex={1000000} | ||
/> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,37 @@ | ||
import { Text, Button, Stack } from "@mantine/core"; | ||
import { Text, Stack } from "@mantine/core"; | ||
|
||
export default function Index() { | ||
return ( | ||
<Stack align="center" mt={50}> | ||
<Text size="xl" weight={500}> | ||
Welcome to Mantine! | ||
<Stack m={50}> | ||
<Text size="xl"> | ||
Check location of close button in the drawer. When using{" "} | ||
<code>yarn run dev</code>, it will be inline with logo. However, when | ||
using <code>yarn run build && yarn start</code>, it will be on a | ||
newline. It appears that the built code does not have styles for the{" "} | ||
<code>div.mantine-Drawer-header</code> element, whereas the dev server | ||
does apply style. | ||
</Text> | ||
<Text size="xl"> | ||
This seems to be due to the fact that the Drawer is within a Portal. | ||
Related issues: | ||
<ul> | ||
<li> | ||
<a href="https://github.com/mantinedev/mantine-remix-template/issues/4"> | ||
mantinedev/mantine-remix-template#4 | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/mantinedev/mantine/issues/2311"> | ||
mantinedev/mantine#2311 | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/mantinedev/mantine/issues/1734"> | ||
mantinedev/mantine#1734 | ||
</a> | ||
</li> | ||
</ul> | ||
</Text> | ||
<Button>Click the button</Button> | ||
</Stack> | ||
); | ||
} |