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

102
Vistas
Clicking disabled button selects next element

This simple code creates a disabled button:

import { Grid, IconButton } from "@material-ui/core";
import ArrowBackIosIcon from "@material-ui/icons/ArrowBackIos";

export default function App() {
  const handleClick = (e) => {
    e.stopPropagation();
  };

  return (
    <div className="App">
      <Grid container>
        <Grid item>Before</Grid>
        <Grid item>
          <IconButton disabled onClick={handleClick}>
            <ArrowBackIosIcon />
          </IconButton>
        </Grid>
        <Grid item>After</Grid>
      </Grid>
    </div>
  );
}

But when clicking on the button the "After" div gets selected. I have tried to prevent it by adding an event hanlder but it does not help.

How can I prevent "After" from being selected when clicking the enabled button?

here is my CodeSandBox: https://codesandbox.io/s/focused-elion-1tmtz0

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

here is i made changes https://codesandbox.io/s/immutable-paper-2ilsfh

Let me know if you need more help

about 4 years ago · Santiago Trujillo 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