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

Paper component is cascading withBorder and shadow property #4930

Closed
aditya-kumar013 opened this issue Sep 30, 2023 · 4 comments
Closed

Paper component is cascading withBorder and shadow property #4930

aditya-kumar013 opened this issue Sep 30, 2023 · 4 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@aditya-kumar013
Copy link

What package has an issue

@mantine/core

Describe the bug

If I give border to a paper component using withBorder prop which's a parent of any other paper component, the children component get's all the styles as well, and it wont' even override even if I specify it via props.

What version of @mantine/* packages do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)

7.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

None

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@rtivital
Copy link
Member

Please provide a sandbox with a minimal reproduction, template – https://codesandbox.io/s/mantine-template-9ze89?file=/src/App.tsx

@rtivital rtivital added the Needs reproduction Issues without reproduction, closed within a week if the reproduction is not provided label Oct 1, 2023
@aditya-kumar013
Copy link
Author

@rtivital
Here's a link to sandbox
https://codesandbox.io/s/magical-wind-p66cqy?file=/src/Parent.tsx

you'll see the child paper component didn't received any border or shadow prop but it's inheriting them from the Parent paper component, and worst of all it wont' rest explicitly, I have to use custom css for that,
but it's not taking padding from parent which is a bit odd

@rtivital rtivital added TBD It is clear how to fix the issue and the fix will be provided soon and removed Needs reproduction Issues without reproduction, closed within a week if the reproduction is not provided labels Oct 12, 2023
rtivital added a commit that referenced this issue Oct 12, 2023
@rtivital
Copy link
Member

The issue with withBorder was fixed. shadow cascading is not planned to be fixed, you need to explicitly set shadow="none":

export function NestedPapers() {
  return (
    <Paper p="md" withBorder shadow="md">
      Parent
      <Paper p="md" shadow="none">
        Child
      </Paper>
    </Paper>
  );
}

@rtivital rtivital added Fixed patch Completed issues that will be published with next patch (1.0.X) and removed TBD It is clear how to fix the issue and the fix will be provided soon labels Oct 12, 2023
@rtivital
Copy link
Member

The issue has been resolved in 7.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants