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

146
Vistas
element shifts when span appears in react

Im currently using React and rendering a span whenever a user hovers over the text element. The issue is that the existing text will shift leftwards(span will appear right of the text), whenever the span appears. Expected behavior is for the span to just appear on right of the text without shifting the text. Is there any way I can do this with css? Please see below for code:

<TableCell 
  classes={{ root: classes.tableCell }} 
  onMouseEnter={() => this.handleMouseEnter(index)} 
  onMouseLeave={() => this.handleMouseLeave(index)} 
  align="center">
      Hello
      {(isHovering) && <span>{this.getTitle(movie.title)} />}
 </TableCell>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It looks like you're missing the closing tag of your span.

Try this:

<TableCell
                                classes={{ root: classes.tableCell }}
                                onMouseEnter={() => this.handleMouseEnter(index)}
                                onMouseLeave={() => this.handleMouseLeave(index)}
                                align="center">
                                Hello
                                {(isHovering) && <span>{this.getTitle(movie.title)} </span>}
 </TableCell>
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