I have a select box in "multiple" mode that fetch its data asynchronously. While waiting for the data, I want the select box to show a spinner. I have the following code working under Chrome, Chromium and Edge but under Firefox (tested on 52 and 57) the box stays plain white.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.multiselect {
width: 300px;
height: 200px;
position: relative;
}
.loading:before, .loading:after{
content: "";
position: absolute;
bottom: 0; left: 0; right: 0; top: 0;
z-index: 1000;
pointer-events: none;
overflow: hidden;
}
.loading:before {
width:100%; height:100%;
background-color: rgba(211, 211, 211, .8);
}
.loading:after {
margin: auto;
width: 32px; height: 32px;
border: 4px solid #F37324;
border-left-color: transparent;
border-top-color: transparent;
border-radius: 50%;
animation: spin 600ms infinite linear;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(359deg); }
}
</style>
</head>
<body>
<div>
<select class="multiselect loading" multiple></select>
</div>
</body>
</html>
I found a tool (https://www.browseemall.com/Compatibility/ValidateCSS) telling me that this CSS is compatible with FF37.
I tried to add vendor specific rules -moz- to @keyframes, transform and animations and to play with z-index and content but with no success so far.