Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4119

Enable ENTER key in textareas and suitable rendering of running text

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Code Review Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.3, 5.10
    • Fix Version/s: None
    • Component/s: JSPUI
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      1
    • Documentation Status:
      Needed

      Description

      Problem

      Currently, DSpace prevents users from inserting line breaks within textareas by pressing the ENTER key .

      This is due to https://github.com/DSpace/DSpace/blob/9c16711dbef079e9eee55b660997b52adf487354/dspace-jspui/src/main/webapp/utils.js#L143, which disables the ENTER key in forms in general.

      But this  simple method to prevent "accidentally submitting a form", hinders the user to write a well structured description or abstract when submitting a publication. Indeed, the user can copy and paste an abstract in the corresponding form field, but when it comes to manual adjustments, there is no convenient way to structure the text with 'headings' and paragraphs.

      Furthermore, when reviewing the submission in the "Verify" step, even previously structured text is displayed as continuous text without any structure. The same display error occurs when viewing a publication. The issue here is, that DSpace escapes the input to prevent XSS, but the HTML encoded line feed (&#x0A) is not rendered as new line in the front end.

      Solution

      The solution might be quite simple. DSpace must only disable the ENTER key in input fields other than textareas, since the default event will insert a line break in textareas and never submit the form by accident.

      To enable suitable rendering of running text in the "Verify" step and in a publication's details view, replacing the encoded line feed with it's HTML equivalent (<br/>) solves the problem.

      I've already created a pull request on Github (https://github.com/DSpace/DSpace/pull/2289), which addresses the mentioned problem.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            r3r57 Cornelius Matějka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: