Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda