Encountering an issue with the input type file on IE11.
In IE11, the input field is displayed as two tab-able pseudo elements (text/button).
Tried using the class ::-ms-browse
to hide the button with display: none
, but it remains tab-able.
To replicate:
- Click inside the text field
- Tab into the input type file (requires two tabs in IE11)
The objective is to conceal the input field and show a label as a button instead. Having to tab twice for one button seems cumbersome.
input[type="file"]::-ms-browse {
display: none;
visibility: hidden;
}
input[type="file"]+label.fake-file-upload {
background: $white;
color: #999;
font-family: "Glober", sans-serif;
font-weight: 600;
font-size: 1.5rem;
padding: 0.75rem 4rem;
letter-spacing: 0.25rem;
cursor: pointer;
display: table;
}
input[type="file"]:focus+label.fake-file-upload {
outline: 2px dotted #444;
outline-offset: 5px;
border-spacing: 5px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
<input type="text" ><br><br>
<input type="file" id="upload-photo" name="photo" required>
<label for="upload-photo" class="fake-file-upload">BROWSE</label>