Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small glitch when using a confirm modal without children #6324

Closed
1 of 2 tasks
sebastien-prudhomme opened this issue Jun 2, 2024 · 2 comments · Fixed by #6325
Closed
1 of 2 tasks

Small glitch when using a confirm modal without children #6324

sebastien-prudhomme opened this issue Jun 2, 2024 · 2 comments · Fixed by #6325

Comments

@sebastien-prudhomme
Copy link

sebastien-prudhomme commented Jun 2, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.10.1

What package has an issue?

@mantine/modals

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

Small visual glitch on the button focus when the confirm modal is not using children:

image

Sample code:

  const openResetConfirmModal = () => modals.openConfirmModal({
    centered: true,
    labels: {
      cancel: "Cancel",
      confirm: "Reset",
    },
    onConfirm: () => reset(),
    title: "Reset the form?",
    withCloseButton: false,
  });

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@sebastien-prudhomme sebastien-prudhomme changed the title Small glitch when using a confirm modal without a close button Small glitch when using a confirm modal without children Jun 2, 2024
@stefanzmf
Copy link
Contributor

This happens because of:

  • modal header css has z-index: 1000; + some other css that overlaps everything
  • highlighting button is done using outline so it is not taking space in box model but stays in place and it s getting overlapped by that header zindex

Not sure if it really worth adding some logic to fix this (if it worth, please let me know). It can be fixed on the spot using

groupProps: {
  style: { paddingTop: '4px' },
},

@Prasiddha22
Copy link
Contributor

As we see there is the logic to add a margin bottom to the container wrapping the children.
Screenshot 2024-06-04 at 10 56 44 PM

As this is happening because of the modal header, when there is no children, there will not be margin-bottom ( present in the children container). So I think we might want to use the similar logic and add margin-top when there is no children just to level it up.
Please let me know if we differ in opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants