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

136
Vistas
CSS toggle-class transitions don't work in Safari

I'm trying to flip multiple div elements at different times in Reactjs by toggling the classes assigned to them.

It works as expected in Opera, Firefox, and Chrome, but not Safari. In Safari, when a single element is flipping, all the other flipped elements disappear. The other non-flipped elements are unaffected though. I'm wondering if this is fixable in Safari so it behaves like the other browsers?

Here's a jsfiddle that will work in all browsers but Safari.

Here's the relevant jsx. 'flipped' is an object with multiple booleans to keep track of which items are flipped and which are not.

  <div className="item">
    <div className={"bg-card" + (flipped[i] ? ' bg-card-flipped' : '')}>
      <div className="bg-image bg-image-front">Front {i}</div>
      <div className="bg-image bg-image-back">Back {i}</div>
    </div>
  </div>

Here's the relevant css:

.item {
  position: relative;
  background-color: black;
  width: 100px;
  height: 100px;
  margin-right: 20px;
}

.bg-card {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}
.bg-card-flipped {
  transform: rotateY(180deg);
}
.bg-image {
  object-fit: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  border-style: solid;
  font-size: 1.4em;
  color: white;
  font-weight: bold;
}
.bg-image-front {
  backface-visibility: hidden;
  background-color: rgb(117, 211, 255);
}
.bg-image-back {
  backface-visibility: hidden;
  transform: rotateY(180deg);
  background-color: rgb(85, 85, 85);
}

Any help would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
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