Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda