The following code forces an enter key to cause a blur, auto-updating quantities. However, it does not prevent the default operation, which is submitting the form. This causes the focused order item to be deleted.

        onKeypress(event) {
          if (event.keyCode === 13) {
            // If the enter key was pressed, blur the element so that change and blur events execute.
            event.target.blur();
          }
CommentFileSizeAuthor
#2 3010609-2.patch844 bytesmglaman

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new844 bytes

Adds event.preventDefault()

  • mglaman committed 243833a on 8.x-1.x
    Issue #3010609 by mglaman: The enter key should not cause an order item...
mglaman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.