Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function FormWrapper({
enabledWhenOffline={enabledWhenOffline}
isSubmitActionDangerous={isSubmitActionDangerous}
disablePressOnEnter={disablePressOnEnter}
enterKeyEventListenerPriority={1}
/>
)}
</FormElement>
Expand Down
5 changes: 5 additions & 0 deletions src/components/FormAlertWithSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type FormAlertWithSubmitButtonProps = {

/** Style for the error message for submit button */
errorMessageStyle?: StyleProp<ViewStyle>;

/** The priority to assign the enter key event listener to buttons. 0 is the highest priority. */
enterKeyEventListenerPriority?: number;
};

function FormAlertWithSubmitButton({
Expand All @@ -73,6 +76,7 @@ function FormAlertWithSubmitButton({
onSubmit,
useSmallerSubmitButtonSize = false,
errorMessageStyle,
enterKeyEventListenerPriority = 0,
}: FormAlertWithSubmitButtonProps) {
const styles = useThemeStyles();
const style = [!footerContent ? {} : styles.mb3, buttonStyles];
Expand Down Expand Up @@ -102,6 +106,7 @@ function FormAlertWithSubmitButton({
<Button
success
pressOnEnter={!disablePressOnEnter}
enterKeyEventListenerPriority={enterKeyEventListenerPriority}
text={buttonText}
style={style}
onPress={onSubmit}
Expand Down