Text Input Validation behavior

Possible bug report or maybe I'm looking at this the wrong way.
I have a few text inputs that have the validation "Required" and a button that triggers a javascript query where I check the validation of those inputs. If the user interacts with each of the text inputs everything is fine, but if they skip this and click the submit button validation hasn't triggered yet and allows them to continue when it shouldn't (despite me manually triggering validation for these inputs in that query).
I made a small app to demonstrate. I dragged a textbox into the new project and set the required validation.


I then added the following javascript query. The first time it runs it says it is valid (I'm not sure if the "await" is appropriate here, but the behavior is the same with or without it) despite it not being valid, the second time it runs it does work properly though.

I also tried making a custom validation and had the same issues.
image
The workaround I've found so far is triggering textInput1.validate() and having all my validations hidden (so the user isn't greeted with a bunch of errors) on launch of the app, then have a javascript query un-hide the validation when a confirmation button is pressed.

Hi @Jay_Walters,

Thanks for reaching out!

For your approach with the JS query, I'm wondering if you can try toggling on this setting under the query's Advanced tab:

That did it, thanks!

Hi @tess,

I know having this property defaulted to true has been discussed before. It apparently has a performance impact and and so it should only be used when needed.

One suggestion would be to automatically enable it when the JS query uses variables that are then subject to this issue. Or possibly, display a notice that you may need to enable this property if the query is using variables. I use this parameter frequently and I still forget at times.

Yes, 100% agree! We have a feature request internally to add a warning that could conditionally show in the query editor depending on whether the code would be impacted by the setting. I'll add another +1 to that request & will follow up here when it ships