RobinHerbots/Inputmask

Is there a way to hide placeholder hyphens and only show them when the characters are entered?

hexerus opened this issue · 2 comments

Using the placeholder option:
<script> $('#phone').inputmask('999-99-9', {'placeholder': ''}); </script>
has disabled the underscore placeholders, but not the dashes.
Image 1 (field not in focus, correct):
Screenshot 2024-07-04 115951
Image 2 (field in mouse focus, these are the dashes I want to hide):
Screenshot 2024-07-04 120005
Image 3 (only show them when the characters are entered up to that point in green, not show the one in red):
Screenshot 2024-07-04 120014

  • OS: Windows 11
  • Browser: Chrome 124
  • Inputmask version: 5.0.10

Use showMaskOnFocus, showMaskOnHover and jitMasking options like this:

$(function() {
  $('#myInput').inputmask('999-99-9',
  {
      placeholder: '',
      showMaskOnFocus: false,
      showMaskOnHover: false,
      jitMasking: true
  });
});

jitMasking: true appears to works alone on itself, thanks.