Hi retool community!
I faced some component validation issue.
In JS environment I'm trying to run component_input.validate() and check if it's valid or not.
input_component.validate();
if (input_component.invalid) {
return;
}
my_query.trigger();
I run this snippet on button click.
The issue is when input_component is empty and this is the first run input_component.invalid is false despite on UI it becomes in red. Once I click a button that triggers this snippet one more time input_component.invalid is true.
I tried await input_component.validate() but this doesn't help.
Maybe I do something wrong or there is some workaround.
Any help is appreciated.