I have the same mechanism in both pages, but one doesn’t work.
I’ll appreciate any advice.
I’m expecting that pressing the Enter key will trigger the customer event.
Both the input field and the group/button are in the same group.
The Enter key is allowed for submitting.
Are you entirely sure that the custom event is not being executed? or maybe it’s being called but the actions within are not executing?
You can check that in the debugger or by placing an unconditioned mock action inside the custom event that triggers something visual, telling you the custom event has beed executed.
As long as you have some text in the search box, I don’t see why your setup wouldn’t work.
EDIT: I just realized that pressing Enter doesn’t work for me either. I’m doing some tests.
For pressing Enter button to work you MUST place both an Input and a Button inside the same group, and link the Enter action to the Button.
Your setup isn’t working because you are actioning from a Group, i.e. the Enter action is executed when clicking a Group, not a Button. Change this and you’ll get it.
Thanks for the input. I have an identical setup on another page using a group instead of a button, and it works there. I tried your suggestion, but it still doesn’t work. Perhaps it’s a bug.
If you copied and pasted the workflow directly from the first page, try re-selecting the dropdowns in the workflow after triggering the custom event. This is because there can be bug with workflows after copy-pasting, which may not cause any issue initially.
If the above step doesn’t work, enable the step-by-step preview feature at the bottom of the preview screen and click on the “G Search” element while previewing. This will show you the workflow steps individually, highlighting what’s being executed and what’s not, including any “only when” conditions.
Thanks for the input.
I didn’t copy it, but I still tried your suggestion to reselect, as well as deleting and creating the workflow again. Nothing works.
The step-by-step preview feature doesn’t get triggered from pressing the Enter key.
Add a JavaScript click event: If there is only one button on the page and you want the Enter key to trigger a click event on that button, you can add a JavaScript click event using the button’s ID attribute. This will simulate a click on the button when the Enter key is pressed.
Place input and button in the same group: As mentioned by ademiguel, you need to place both the input field and the button in the same group. This will allow the Enter key to be recognized and trigger the button’s action.
Here is support response that clarified this issue:
The unexpected behavior you were seeing was due to the Input Search element having the “This input should not be empty” property enabled. When this setting is checked, Bubble will prevent any workflow—including custom event from running if the input’s value is empty at the time the workflow is triggered.