This appears to be a limitation/bug in the Android browser: it seems to fail to implement text-overflow: ellipsis
on any input
element.
For example, instead of <input name=foo value="some long string here" width=100%>
, you could use
<style>
.hidden {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
</style>
<div class=hidden>some long string here</div>
<input type=hidden name=foo value="some long string here">
For a readonly field, there is a simple workaround: duplicate the data, first in (say) div
element, on which you set text-overflow: ellipsis
, and then in a hidden field. You may wish to style the first element to look like a readonly field, but keeping it as normal text would make it even clearer to the user that this data cannot be edited using normal means.
As usual with small devices, you normally need something like <meta name="viewport" content="width=device-width,initial-scale=1">
to make 100%
correspond to actual device width.