The cursor jumps a few characters to the right when clicking on a search box if it has left padding.
I have narrowed the problem down to padding-left
and type="search"
. The problem goes away if I remove either left padding or change the input type to type"text"
instead of type="search"
.
Here is a minimal reproducible example of the problem:
#myelementId.myelementClass {
margin: 1px 29px 1px 1px;
height: 38px;
width: 500px;
padding-left: 19px;
}
<form>
<div>
<input class="myelementClass" id="myelementId" type="search" />
</div>
</form>
I am using Chrome Version 77.0.3865.120 (Official Build) (64-bit). When I type something in the search box, then click on any character, the cursor will appear a few characters to the right.
This issue does not occur on the following: (tested by Skylar)
- Microsoft Edge 44.17763.771.0
- IE 11.775.17763.0
- FireFox 69.0.3
IMPORTANT: I can't change the type or padding as I need to do this in production where most of the code is not mine.