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

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

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.0
    • None
    • Security Level: Jimmy
    • None

      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

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

              Created:
              Updated:
              Resolved:

                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