0

I'm trying to fix an issue on my inputs, where I change the style of the font to italic whenever the input is dirty. This works fine on Firefox. However on Chrome, when I apply font-style: italic; to a text input with, for instance, size="5", the input repaints itself with a different width.

You can check a basic example here: https://codepen.io/anon/pen/aeNoBV

Just remove the style of the input.

Is this a bug on Chrome, or am I missing something?

Sebastianb
  • 2,020
  • 22
  • 31

1 Answers1

1

The size attribute on input causes input width calculation that depends on the character font on Chrome.

Check this answer.

I'd recommend to use another method for the input like width itself that regardless of the font-style will not be modified.

Azametzin
  • 5,223
  • 12
  • 28
  • 46