diff --git a/app/client/src/widgets/InputWidget.tsx b/app/client/src/widgets/InputWidget.tsx index 4388ec1122..1957c0dbcd 100644 --- a/app/client/src/widgets/InputWidget.tsx +++ b/app/client/src/widgets/InputWidget.tsx @@ -154,10 +154,11 @@ class InputWidget extends BaseWidget { | React.KeyboardEvent | React.KeyboardEvent, ) => { + const { isValid, onSubmit } = this.props; const isEnterKey = e.key === "Enter" || e.keyCode === 13; - if (isEnterKey && this.props.onSubmit) { + if (isEnterKey && onSubmit && isValid) { super.executeAction({ - dynamicString: this.props.onSubmit, + dynamicString: onSubmit, event: { type: EventType.ON_SUBMIT, callback: this.onSubmitSuccess,