imaskjs icon indicating copy to clipboard operation
imaskjs copied to clipboard

onAccept event are not fired in version 7 when autocomplete by browser

Open bezuglyyvlad opened this issue 1 year ago • 5 comments

Describe the bug Upgraded the package from 6.* to 7.*, and the onAccept and event are not fired. We use React with react-imask and autocomplete for input element.

To Reproduce STR:

  1. Add input with mask (use IMaskInput)
  2. Set mask for example - '00000'
  3. Add autocomplete attribute for input - 'postal-code'
  4. Set autocomplete data (need postal-code data) in browser (example of desktop settings - chrome://settings/addresses)
  5. Enter data in input using autocomplete

CodeSandbox

Expected behavior onAccept fired on IOS Chrome when autocomplete by browser

Environment:

  • OS: IOS
  • Browser chrome
  • Version 129.0.6668.69
  • IMask version 7.6.1
  • React 18.0.0

Additional context related closed PR: https://github.com/uNmAnNeR/imaskjs/issues/1047

bezuglyyvlad avatar Oct 12 '24 12:10 bezuglyyvlad

faced with the same issue additional information

  • in console we have notifiacation Element value was changed outside of mask. Syncronize mask using mask.updateValue() to work properly.
  • mask.updateValue() on blur does not work
  • mask.updateValue() on input does not work
  • mask.displayValue has empty string (in my case initial value)
  • value, unmaskedValue also contains empty string

SOjuD avatar Oct 16 '24 10:10 SOjuD

I’m running into the same issue with the warning Element value was changed outside of mask. Synchronize mask using mask.updateValue() to work properly.

mauribuffa avatar Oct 16 '24 12:10 mauribuffa

Although I haven't confirmed (I don't have an iPhone to use for deeper troubleshooting), I believe this issue may be the source of a problem my users are seeing, where autocomplete entry isn't working correctly in Chrome on iPhone for our app. Our Customer Support team has confirmed the problem, with video capture. In this case, the autocompleted input seems to disappear on blur.

It works fine in Chrome/Android, and even Chrome on iOS on a MacBook Pro. It only appears to be a problem (for us at least) on Chrome/iPhone.

I've had to resort to the autocomplete="one-time-code" hack to disable autocomplete across the board to avoid this issue.

zacronos avatar Oct 23 '24 17:10 zacronos

Hi @uNmAnNeR ! It would be great to have this issue fixed 🙏 , because currently we are forced to use the 6.* version, since it doesn't have this bug.

YauheniAndryieuski avatar Oct 23 '24 20:10 YauheniAndryieuski

I'm having the same problem with the autofill in mobile browsers

vctormb avatar Dec 12 '24 20:12 vctormb