Reuse `hidePlaceholder` in `makeKeyupHandler`.
Add `maxlength` storing and restoring code.

- If we don't get rid of the `maxlength` attribute on the input element,
  sometimes it's the case that the element doesn't accept any new input
  to clear the placeholder because max-length is already exceeded.