AntDesign TabPane min-height 100%

All we need is an easy explanation of the problem, so here it is.

Using Ant.Design Tabs https://ant.design/components/tabs/

How can I set styling on TabPane so that it’s min-height is always 100% height of the window even when it’s empty?

Below example should cover the window with color #F5F5F5

Edit epic-flower-tg0g3

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

This has worked for me.

<TabPane tab={tab.title} key={index}>
<Row>
  <Col style={{minHeight: "100vh", maxheight: "100vh"}}>
   Test
  </Col>
</Row>
</TabPane>

Method 2

So this has worked for me too

   <Tabs
      onChange={() => {
      console.log("oi");
      }}
      type="card"
      style={{ background: "blue", height: "100%" }}
   >
   <TabPane
      tab="Tab 1"
      key="1"
      style={{ minHeight: "100vh", background: "red" }}
   >
      Content of Tab Pane 1
   </TabPane>
 </Tabs>

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply