I'm having an issue with a transform rotation inside a focus selector. It works OK in Chrome, Opera and Firefox, but it does not work in Edge.
As you can see in the code snipplet when you focus on the textbox div, the icon grows and its color changes (that is done OK in all browsers), but when it comes to the rotation after the scale it does not work in Edge. I did some research and found a couple of posts that I thought were similar to my issue:
- CSS Animation not working in IE/Edge.
- CSS transform is not working in Edge.
- Transform scale not working after rotation.
However, I don't think any of them suit this case. Because it does the transform and the animation but only for scale so I don't think is a compatibility issue, otherwise it wouldn't do neither.
.vm-id-textbox {
position: relative;
order: 0;
margin: auto 0px;
min-width: 280px;
width: 280px;
height: 52px;
}
.vm-id-textbox:hover {
cursor: pointer;
}
.vm-id-textbox:hover .textbox {
background-color: black;
transform: scale(1.02);
}
.vm-id-textbox:hover .edit-icon {
color: gray;
transform: scale(1.4);
}
.textbox {
position: absolute;
min-width: 280px;
width: 280px;
height: 52px;
border: none;
border-radius: 12px;
background-color: rgba(4, 4, 66, 0.904);
line-height: 52px;
font-size: 15px;
text-align: center;
color: white;
text-shadow: 1px 1px rgb(106, 90, 90);
overflow: hidden;
transition: transform 200ms ease-in;
}
.textbox[contenteditable][placeholder]:empty::after {
content: attr(placeholder);
opacity: 1;
color: rgba(135, 133, 147, 0.537);
text-shadow: none;
}
.textbox[contenteditable][placeholder]:focus::after {
content: "";
}
.textbox:focus {
background-color: black;
transform: scaleX(1.02);
}
.textbox:focus + .edit-icon {
color: gray;
transform: scale(1.4) rotate(-360deg);
}
.edit-icon {
position: absolute;
margin: 17px 0px 0px 250px;
color: white;
transform: scale(1.2);
transition: transform 400ms cubic-bezier(0.65, 1.33, 0.7, 1.43)
}
<script src="https://kit.fontawesome.com/d0c76ce6ff.js" crossorigin="anonymous"></script>
<div class="section vm-id">
<div class="vm-id-textbox">
<div class="textbox" contenteditable placeholder="Enter an ID..." oninput="togglePlaceholder();"></div>
<i class="fas fa-edit edit-icon"></i>
</div>
</div>
Hope you can help me understand what I am doing wrong!