Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Fix submit on enter for relationship input #241

Merged
merged 7 commits into from May 19, 2020

Conversation

Leigan0
Copy link
Contributor

@Leigan0 Leigan0 commented May 13, 2020

Why?

Bug Fix ticket

Create a child record at /ChildType/create

Go to the edit page for a MainType record and in the children field type the child's code - hopefully there will only be a single item in the autocomplete list

Press enter

Expected - Adds a row below the input contain the child record and clears the input and autocomplete

Actual behaviour - Adds a row below the input contain the child record and submits the entire form

What?

  • When following the above steps the following error appeared in the console

Screenshot 2020-05-13 at 09 45 19

  • This method event.stopImmediatePropagation(); is not a function on keypress event so it stopped the prevent default
  • removed that line of code and this fixed the bug

Screenshots / Images

Before

…- preventDefault from running - which caused form submit on input selection
@Leigan0 Leigan0 requested a review from a team as a code owner May 13, 2020 08:48
@Leigan0 Leigan0 marked this pull request as draft May 13, 2020 08:48
@Leigan0 Leigan0 marked this pull request as ready for review May 18, 2020 12:10
Copy link
Contributor

@wheresrhys wheresrhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@Leigan0 Leigan0 merged commit fd24815 into master May 19, 2020
@Leigan0 Leigan0 deleted the stop-form-submit-on-relationship-entry branch May 19, 2020 07:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants