bullhorn / novo-elements

UI Repository for Bullhorn's Novo Theme
http://bullhorn.github.io/novo-elements
MIT License
76 stars 61 forks source link

Field Interaction markAsInvalid not running when form is initialized. #1031

Open soucerer opened 5 years ago

soucerer commented 5 years ago

Describe the bug When the form is initialized, the markAsInvalid method of the FieldInteractionAPI does not mark the field as invalid. The field interaction script was added to a field in Bullhorn via the field mappings with the "Run on init" option selected.

Expected behavior When the form is initialized in Bullhorn, the field should be marked as invalid.

Actual behavior When the form is initialized in Bullhorn, the field is still marked as valid until the user clicks the field and moves away, triggering the blur event.

Specifications

Screenshots

Basic sample script: ValidationOnInitFieldInteraction

Additional context Encountered the same behavior when using the "On Init" and "On Change" event option.

blitzmann commented 4 years ago

We also ran into this issue a while back, very annoying

blitzmann commented 4 years ago

Is there any response from Bullhorn about this?

g-testo commented 1 year ago

This is still an issue today. I believe it's a race condition because I wrapped the "markAsInvalid" in a 300 ms setTimout and it now disables the form on init. You could also look into lowering sortOrder too