Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21613

f:combobox may break form.onsubmit

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Trivial
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins 1.532.1
    • Similar Issues:

      Description

      f:combobox prevents form submission when the dropdown is open.
      This is done by interrupting form.onsubmit.
      It handles form.onsubmit in the following way:

      1. ComboBox saves the original onsubmit handler in its initialization.
      2. When the combobox is selected, it shows the dropdown and overwrites the onsubmit handler. The ovirridden onsubmit prevents form submission of the dropdown is open.
      3. When the dropdown is closed, recovers the saved form.onsubmit.

      The step 1 is called from Behavior module with priority 100.
      If the form.onsubmit was overridden between step 1 and 2 (that is, if there is a behavior overriding form.onsubmit with priority > 100), it would be overridden in step 3 and lost.

      I see this problem happen in Jenkins 1.480, which has not introduced priorities in Behavior module, and it fails to build json to submit.
      Though it no longer happens in the latest Jenkins as they introduced priorities in Behavior module, I want to fix this behavior as this can be harmful in some situations.

        Attachments

          Activity

          Show
          ikedam ikedam added a comment - https://github.com/jenkinsci/jenkins/pull/1111
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          war/src/main/webapp/scripts/combobox.js
          http://jenkins-ci.org/commit/jenkins/d0ff4135e9fbe86faf2caeb28c9e180b406eb6d1
          Log:
          [FIXED JENKINS-21613] combobox now recovers form.onsubmit to the one just before override.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: war/src/main/webapp/scripts/combobox.js http://jenkins-ci.org/commit/jenkins/d0ff4135e9fbe86faf2caeb28c9e180b406eb6d1 Log: [FIXED JENKINS-21613] combobox now recovers form.onsubmit to the one just before override.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The fix has been integrated towards 2.114

          Show
          oleg_nenashev Oleg Nenashev added a comment - The fix has been integrated towards 2.114

            People

            • Assignee:
              ikedam ikedam
              Reporter:
              ikedam ikedam
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: