Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
Tooltip on disabled Tab - Material Ui, React

I am new to React and UI in general.

can someone help me to correct this?

I am using Material Ui Tabs in my Component and not able to get a tooltip on one of the disabled Tab.(code snippet added below)

<Tooltip title={sample_title}>
       <span>
          <Tab
          disabled
          value={some_Random_title}
          classes={tabStyleOne}
          label={
          (
           <Typography variant="caption" align="center" classes={renditionHeader}>
           {some_random-text}
           </Typography>
          )
          }
         />
     </span>
</Tooltip>

I am encapsulating my Tab in Span as asked in Material-UI Tabs Documentation for disabled Tabs

https://codesandbox.io/s/wc74r?file=/demo.js

Please help me understand where I am doing wrong. and how to achieve tooltip on disabled Tab in material UI.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

this is what I found I while ago and what I'm currently using.

// outside the component
function CloneProps(props) {
  const { children, ...other } = props;
  return children(other);
}

// when you render the component
<Tabs value={selectedTab} textColor="inherit" indicatorColor="secondary">
  <Tab 
    component={NavLink} 
    to={`${url}/tab1`} 
    label="Tab 1" 
  />
  {/* Hack for tooltip on disabled tab */}
  <CloneProps>  
    { tabProps => (
      <Tooltip title={tabIsDisabled ? "Tooltip title" : ""} arrow>
        <div>
          <Tab 
            {...tabProps}
            component={NavLink} 
            to={`${url}/tab2`}
            label="Tab 2" 
            disabled={tabIsDisabled}
          />
        </div>
      </Tooltip>
    )}
  </CloneProps>
</Tabs>

Mauro

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!