The following code presents three options as labels for a radio button group.
When clicking a label, the background-color
should transition.
It works as expected in Chrome and Safari 13.0.4 on OSX 10.15.2, but in iOS 13.3.1 a style (the label darkens) is briefly applied to the label immediately after touching.
Why might this be? Perhaps a touch-related pseudo class is being activated briefly and the browser stylesheet is causing the appearance of flicker.
input[type="radio"] {
display: none;
}
label {
font-family: sans-serif;
padding: 10px;
margin: 10px;
display: block;
cursor: pointer;
border-radius: 5px;
}
input[type="radio"]+label {
background-color: rgba(0,220,220,0);
transition: background-color 1.5s ease-in 0s;
}
input[type="radio"]:checked+label {
background-color: rgba(0,220,220,1);
}
#time {
width: 100%;
font-family: sans-serif;
font-size: 2em;
text-align: center;
}
<input type="radio" name="group1" id="london" checked>
<label for="london">London</label>
<input type="radio" name="group1" id="amsterdam">
<label for="amsterdam">Amsterdam</label>
<input type="radio" name="group1" id="new-york">
<label for="new-york">New York</label>
<div id="time"></div>