Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3875

Multiline Textbox fires onOK event when pressing enter key which is configurable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 8.5.0
    • Fix Version/s: 8.5.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      current status

      when pressing enter key in <textbox multiline="true" rows="5" onOK=""/>, currently, it doesn't fire onOK event.

      use case

      There are at least 2 kinds of use cases for a multi-line textbox. Users will expect different behavior when pressing an "enter".

      • text editor
        users edit a text/doc, therefore, when pressing "enter" key, they expect a new line.
      • message sender box

        Users type a message in a textbox like Skype, Facebook message, Hangout. Therefore, they expect to send the message when pressing "enter" key. Only pressing shfit+enter produces a new line.

      Since both cases are reasonable usage, so Textbox should provide an attribute to determine whether to send onOK event. like *tabbable", it determines whether to insert a tab or move focus out of a Textbox (both are valid).

      proposed spec

      textbox atrribute: submitByEnter
      default: true

      • When it's true, a textbox sends onOK event when pressing the enter key no matter multiline is true or false
        • with multiline="true", shift+enter still produces an new line
          <textbox submitByEnter="true" multiline="true">
          
      • When it's false, pressing the enter key doesn't send onOK event no matter multiline is true or false

        Activity

        Hide
        JamesChu JamesChu added a comment -

        Ready since 2018/04/26

        Show
        JamesChu JamesChu added a comment - Ready since 2018/04/26

          People

          • Assignee:
            CharlesQiu CharlesQiu
            Reporter:
            hawk hawk
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Time Spent - 4 hours Remaining Estimate - 4 hours
              4h
              Logged:
              Time Spent - 4 hours Remaining Estimate - 4 hours
              4h