*sigh*
Yup, it is indeed messed up in Edge. I stuck some breakpoints in, and Edge is firing a 'blur' event when you click on the dropdown, *before* the selected value is assigned to the field. OK, the autofill dropdown is technically outside the field, but clicking on it doesn't remove focus from the field, so I don't get why they fire that.
Neither Chrome nor Firefox do that - in fact, they don't fire anything on the field with the focus till the user blurs. So there is no subjective difference to our code, as to whether the user types something and blurred, or selected the autofill and blurred. The result is obviously that when our validation JS fires on the 'blur', it works fine in Chrome and Firefox, but in Edge, we're validating an empty field.
The other BIG difference I noticed is that both Chrome and FF fire 'change' events for any other fields they change when you select your form fill. So if I select "Hugh" from Chrome or FF on "First Name", and it fills out my Last Name and Email fields, it fires change events for Last Name and Email immediately (although not on the First Name), then it fires a blur (and a change) on the First Name when I click or tab out of it.
However, IE doesn't fire 'change' for any other fields it fills. It seems to fire an 'input' for them, but I can't use that for validation, because 'input' fires for every user input in a field, ie. for every key press. So if I watch for 'input', I'd be running the validation for every letter typed.
I think I can mitigate this by listening for 'change' rather than 'blur', so at least in Edge it won't try and validate an empty field. But I'm kinda stumped on how to handle validation of any other fields Edge autofills.
I'm reluctant to commit that mitigating change just yet, as I need to run with it for a while and see if there's any unexpected side effects. If you want to try it (and I'd appreciate help testing), change this line ...
https://github.com/Fabrik/fabrik/blob/master/components/com_fabrik/models/element.php#L1248
... to ...
Code:
$ar = array('id' => $id, 'triggerEvent' => $this->getChangeEvent());
That should make it so your field elements listen for 'change' rather than 'blur' for AJAX validation.
-- hugh