HTML Input cursor position issue in Chrome when value is empty
Cause:
Looks like this is a regression bug in the Chromium 38 engine. I can reproduce in Chrome 38.* and Opera 25.* (which uses Chromium 38).
Reported Bug/s:
As pointed out by @JackieChiles it appears to be a regression of this [closed as obselete] bug: https://code.google.com/p/chromium/issues/detail?id=47284
As suggested in the closed bug, I have logged a new one. https://code.google.com/p/chromium/issues/detail?id=426802&thanks=426802&ts=1414143535
And have also referenced another reported bug which appears to highlight the same bug, yet fails to define the exact issue in a generic way.https://code.google.com/p/chromium/issues/detail?id=394664
Workaround:
As detailed in other answers above the workaround is to avoid using a pixel-based line-height
attribute. For example swapping line-height:50px
to line-height:1em
or line-height:100%
will yield more expected behaviour.
Adding line-height:100%
seems to fix the issue for us:
i suggest don't use line-height
at all, it may not be the proper answer but its working for me (latest chrome)
Updated fiddlehttp://jsfiddle.net/efgq1svz/11/