Value of input changes → onChange
When you click into the input → onFocus
When the input loses focus because you clicked somewhere else or pressed Enter → onBlur
Thanks for this. However, how does one go about that? The blur event is only available inside the component and components don’t have access to app level data or page variables. Even open page doesn’t seem to work and I would need to pass the search query to through a page parameter. Thanks
yeah sure its better now, but keep this guide in mind because it works for triggering events n any composite component (those that you have to double click to open)
Hi,
I tried to use the “onBlur” for my app, but found that it executed (as expected) every time something was clicked on the screen after the text input was selected. For my purposes this wasn’t an acceptable workaround.
Instead, I did the following, which worked for my purposes:
I set the Input Field to be multiline (this took some formatting of the screen to look good)
Within the Input Field I used the “onChange” event with an “If Condition” to look for a line break in the Input Field. The formula for this was:
MATCHES_REGEX(pageVars.varAnswer, “\n”)
Note that “pageVars.varAnswer” is the variable attached to the Input Field
If the line break was found, I then set a true/false variable to true which then triggered the result I wanted when “enter” is pressed.
This worked for my app, hopefully this is useful for others too!