My app provide a search function.
Users usually press enter button to search but when they press the button nothing happens.
So they have to click a search button on the screen for searching.
I worked hard to develop my app service but this one little issue make users think my app is not good enough.
It would be great if pressing enter button on the keyboard trigger actions with input value.
The input “onBlur” event fires when the user presses Enter, so you can use that one to run your search logic:
Thats interesting. I would have thought that would trigger an onFocus event.
Here’s when the different events fire:
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
if you are not using the primitive input component you need to add an event in the composite component,
i show how here
actually you can add click events / or any event in a composite component like this
then go to properties then event and add a new event
Then in the view, add the trigger event in the component tap of the component you want and define it with the event you just made
And then outside the composite component use the trigger event to bind with whatever you want
Hope it helps!
@Brenton_Richards the Input field component has now been modified to expose the internal events by default.
Great timing on that one! Haha.
Still find the whole thing a bit complex for what’s needed. But the update seems to have mitigated all this. Thanks for the help!
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)
For sure, I just need to play around with the event. Thanks again.