jquery.customSelect
jquery.customSelect copied to clipboard
Safari Autofill not updating selection value
When autofilling a credit card form with Safari, the selected values that display to the user in the "faked" dropdown span class="customSelect"
are not accurate. If I click on the dropdown the correct value is checked in the option list, but the customSelect instance is not updated/refreshed with the correct value. I must choose another value, then my original value for it to update.
For anyone who's interested, I came up with a solution outside of jquery.customSelect in order to get the desired behavior when a form is autofilled. Since I know autofill fill in at least the first name field I trigger an 'change' event to fire which in turn makes customSelect update its span
values.
$('#id_first_name').on('blur', function() {
// fix for jquery custom select bug when autofilling
$('select').trigger('change');
});