Modals styling issues when using @mantine/remix
See original GitHub issueWhat package has an issue
Describe the bug
Steps to reproduce:
- I started with mantine-remix-template
- I added
@mantine/modals
to package.json - In root.tsx I added ModalsProvider
<ModalsProvider
modalProps={{ centered: true }}
>
<Outlet />
</ModalsProvider>
- I added this code to index.tsx
import { Text, Button, Stack } from '@mantine/core';
import { openConfirmModal } from '@mantine/modals';
export default function Index() {
const openModal = () =>
openConfirmModal({
title: 'Please confirm your action',
children: (
<Text size="sm">
This action is so important that you are required to confirm it with a modal. Please click
one of these buttons to proceed.
</Text>
),
labels: { confirm: 'Confirm', cancel: 'Cancel' },
onCancel: () => console.log('Cancel'),
onConfirm: () => console.log('Confirmed'),
});
return (
<Stack align="center" mt={50}>
<Text size="xl" weight={500}>
Welcome to Mantine!
</Text>
<Button onClick={openModal}>Click the button</Button>
</Stack>
);
}
While the modal looks good in dev mode, after a yarn build
+ yarn start
the styles are off:
What version of @mantine/hooks page do you have in package.json?
5.1.0
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Considerations for Styling a Modal | CSS-Tricks
It's tempting to use an overflow value right on the .modal itself, but there are two problems with that: We might want some...
Read more >Bootstrap 3 modal fires and causes page to shift to the left ...
Fixing the shifting left issue is easily done using CSS alone. ... have fixed navbar and dont want to scroll body to top...
Read more >Working with Bootstrap's Modals in React | Pluralsight
After the installation is complete, you can import the modal component and the styling into your module. 1import Modal from "react-bootstrap/ ...
Read more >Modal · Bootstrap v4.5
Modals are built with HTML, CSS, and JavaScript. · Clicking on the modal “backdrop” will automatically close the modal. · Bootstrap only supports...
Read more >W3.CSS Modal - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, @rtivital I have a problem with React 18 and Remix.
Trying to use your example of integrating Mantine into Remix, but Remix is using now
renderToPipeableStream
instead ofrenderToString
. And I don’t know where to putinjectStyles
method as I don’t have a markup to use it.This is an example code you will get after initialization of the new remix app
entry.server.tsx
:For the record, removing the
ClientProvider
brings up the following hydration bugs for me:Reproducible example found here: https://github.com/alukach/mantine-remix-rendering-issue