Skip to content

Commit

Permalink
Find the component by action type.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Jul 5, 2024
1 parent c65933e commit 508790e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/_classes/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,18 @@ export default class Input extends Multivalue {
if (key === 13) {
event.preventDefault();
event.stopPropagation();
const submitButton = this.root?.getComponent('submit');
let submitButton = null;
if (this.root?.everyComponent) {
this.root.everyComponent((component) => {
if (
component?.component.type === 'button' &&
component?.component.action === 'submit'
) {
submitButton = component;
return false;
}
});
}
const options = {};
if (submitButton) {
options.instance = submitButton;
Expand Down

0 comments on commit 508790e

Please sign in to comment.