Correctly calculate the width left, used bu the input box.
Margins, paddings and borders are taken into the calculation.