In Internet Explorer 11, the blinking text cursor inside an input field containing some typed-in text remains visible when a dropdown menu toggles open over the input field. I expect the cursor to be obscured when it's behind the menu like in Chrome/Firefox/Safari.
I found this issue when I entered random text in the input field and then (without clicking out of the input field) hovered over the dropdown button to prompt the dropdown menu to toggle open over the input field. I've tried adjusting the input field's z-index, but have not been able to get that cursor to go away.
How can I get that cursor to stay hidden for IE11?
Screenshot:
Snippet:
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: #3e8e41;
}
<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the button to open the dropdown menu.</p>
<div class="dropdown">
<button class="dropbtn">Dropdown</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
<br>
<hr>
<br>
<form action="/action_page.php">
First name: <input type="text" name="FirstName"><br>
<input type="submit" value="Submit">
</form>