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

Tabs/Tab - missing padding between Tab Control & Tab Content #126

Closed
cstrat opened this issue Jul 6, 2021 · 7 comments
Closed

Tabs/Tab - missing padding between Tab Control & Tab Content #126

cstrat opened this issue Jul 6, 2021 · 7 comments

Comments

@cstrat
Copy link
Contributor

cstrat commented Jul 6, 2021

Question on Tabs, there previously was padding between the tab bar and the tab content.
Do we now need to use the Styles API to inject some padding, or is the below a bug.

No padding at all - which is strange because even in the docs there is padding.
See the highlighted text butts up against the outline tab bar.
This is happening across all the tabs in my app (using mix of default and outline variants).

My App (seems broken):
image

Mantin Docs (works correctly!):
image

The immediate child inside the <Tab> is a <form> - but not sure why that would make a difference.
Other tabs which are affected have <Text> or vanilla <div> as the immediate children.

Code for my screenshot:

<div style={{ position: 'relative' }}>
  <LoadingOverlay visible={loading} />
  <Tabs variant="outline">
    <Tab
      disabled={disableTabs}
      icon={<FontAwesomeIcon icon={faAddressCard} />}
      label="Profile"
    >
      <form>...</form>
    </Tab>
  </Tabs>
</div>
@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

Tested this across both Chrome and Safari.
Tested in incognito window and ensured no cache.

@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

Example:
https://codesandbox.io/s/mantine-tabs-padding-3zpnc?file=/src/App.js

Docs:
image

Example:
image

If the idea is that each <Tab> adds its own padding, that should be explained? (the docs code example is missing this - but could be a global style override?)
Although it makes more sense that the <Tabs> has a padding offset to the content below.
I tried but can't even manually add this with style={{ padding: 16 }}.

@cstrat cstrat changed the title @mantine/core - Tabs Tabs/Tab - missing padding between Tab Control & Tab Content Jul 6, 2021
@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

By default Tabs do not have padding-top to allow something like this, my idea was that you provide padding on children:

<Tabs>
  <Tab><div style={{ paddingTop: 20 }}>My children</div></Tab>
</Tabs>

But I see, how it can be confusing, I'll add tabPadding prop to Tabs component in 2.0.2

@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

I only noticed because there previously was padding in 1.3.
Happy if that's the way forward but it would be good if we didn't need to add padding to each Tab but rather once in the Tabs element. So tabPadding in Tabs would be ideal.

1.3
image

2.0
image

https://codesandbox.io/s/mantine-tab-padding-zqo3e?file=/src/App.js -- flick between the versions.

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

Yes, that's changed in 2.0.0, I forgot to put it in changelog, anyway I'll add tabPadding prop and it will be the same as in 1.3 by default

@cstrat
Copy link
Contributor Author

cstrat commented Jul 6, 2021

Thanks again for the great release!

@rtivital
Copy link
Member

rtivital commented Jul 6, 2021

Resolved with #135

@rtivital rtivital closed this as completed Jul 6, 2021
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

No branches or pull requests

2 participants