Open michaelphipps opened 4 years ago
@RobinHerbots any comments on this please?
I 've just read and tried your issue and you are correct. I will try to Fix this asap.
Op wo 13 jan. 2021 12:20 schreef sKopheK notifications@github.com:
@RobinHerbots https://github.com/RobinHerbots any comments on this please?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobinHerbots/Inputmask/issues/2388#issuecomment-759384067, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACNX36HCFMF3EPAU4BRCLLSZV6YXANCNFSM4RA733PQ .
It's still happening.... 2023...
Hi @RobinHerbots
TLDR; Input fields with an autocomplete attribute will be modified whenever autofill is used if an inputmask is applied. Expected behaviour is once a field with autocomplete contains data, it does not get modified by autofill.
Scenario: I have three fields.
Normally in a browser with autofill enabled, clicking on any of the fields will pop up the autofill selection. I select one of the details and the form gets filled with those details.
If I then click on one of the other fields, the autofill popup is displayed again. When I select one of the details, only the field I am on gets updated, because the other fields already have content.
When I add an input mask to the mobile number:
The behaviour is the same for an empty form.
Once the form contains details, if I click on a field that has autocomplete and select any autofill option, it will modify any field containing an autocomplete attribute that has the inputmask applied, even if the field contains manually entered information
In this image I have manually entered a mobile number and have clicked on the address to change address
I selected a different address, and you will see the mobile number has been changed
Here is the demonstration: https://codepen.io/michaelphipps/pen/XWdZBgv
When you open that pen, the inputmask is initially commented out in the javascript window to show the normal behaviour. Uncomment to see how inputmask modifies fields that contain data when an option is selected from the autofill popup