Reviewed:  https://review.openstack.org/461490
Committed: 
https://git.openstack.org/cgit/openstack/horizon/commit/?id=d1267da469d89c0a487095695fcfe59dce2e2a7c
Submitter: Zuul
Branch:    master

commit d1267da469d89c0a487095695fcfe59dce2e2a7c
Author: Jeremy Moffitt <jeremy.moff...@suse.com>
Date:   Mon May 1 12:28:17 2017 -0700

    Prevent "enter" from triggering submit action on modal forms
    
    testable in particular on the containers page, where
    the problem was that pressing enter with no container
    name would submit the form despite being invalid.
    
    initially tried a more complicated function wrapper
    that allowed panels to prevent submit on enter, but
    that was overly complicated and only fixed the problem
    for panels that are pro-actively changed.
    
    second attempt at fixing the problem was to change
    the wrapping element from "form" to "div", which
    solved the original problem, but caused a new issue
    in that divs aren't validated, so the submit button
    was always enabled (since the div was never $invalid)
    
    this fix explicitly checks whether the form is valid
    when a submit action occurs, and if it is will
    call the uibmodal close action that is what normally
    happens when "submit" is pressed. if the form is
    invalid, nothing happens.
    
    Change-Id: I5071d78b08201436e50c704fdc20b6e4a19aee49
    Closes-Bug: 1655487


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1655487

Title:
  Create Container [enter] on blank field raises error

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  If you leave the field blank, the 'Submit' button is disabled.
  However, if you press 'Enter' it will trigger an action and raise this
  error behind the modal:

  "Danger there was an error submitting the form."

  This is on the server side:
  Forbidden (CSRF token missing or incorrect.): /project/containers/
  [10/Jan/2017 23:02:30] "POST /project/containers/ HTTP/1.1" 403 2274

  Speculation:
  Seems like it's only for schema forms? Same issue with this one: 
https://review.openstack.org/#/c/344572/
  Does not seem to occur when the HTML template is used (no issue here: 
https://review.openstack.org/#/c/341945/). The other difference is that this 
uses a modal workflow...?

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1655487/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to