Keyboard Input on contenteditable Element Triggers Shortcuts

XMLWordPrintable

    • Severity 3 - Minor

      NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.

      Summary

      Keyboard input on an HTML element with contenteditable="true" causes JIRA keyboard shortcuts to trigger. Affects JIRA version 7.3.1.

      Steps to Reproduce

      1. Add an HTML element with contenteditable="true" to JIRA. This can be done by a web panel as a plugin via adding:
          <web-panel name="MyPanel" key="mypanel" location="atl.jira.view.issue.right.context">
            <resource name="view" type="static"><![CDATA[<p contenteditable="true">This is editable</p>]]></resource>
          </web-panel>
        

        to atlassian-plugin.xml.

      2. Give this element keyboard focus and type c.}} {{

      Expected Results

      The character is inserted into the HTML element.

      Actual Results

      The "Create Issue" shortcut is triggered.

      Notes

      I've checked the shortcuts' module code and it seems that the event listener is only taking in consideration inputs. If the jQuery selector includes the [contenteditable], the issue will be resolved:

      shortcuts.js
      function keypress(event) {
          if (jQuery(event.target).is(":input:not(button[type=button])")) {
              // Note: Resetting the key stream isn't necessary here, since
              // this will be done by keyup.
              resetKeyStream();
              // Ignore "aui:keypress" events inside form elements.
              return;
          }
          ...
      }
      

            Assignee:
            Unassigned
            Reporter:
            Tony Gong (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: