-
New Feature
-
Resolution: Done
-
Normal
-
8.5.0
-
None
-
Security Level: Jimmy
-
None
-
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">
- with multiline="true", shift+enter still produces an new line
- When it's false, pressing the enter key doesn't send onOK event no matter multiline is true or false