]> source.dussan.org Git - vaadin-framework.git/commit
Fix TextArea with enter keyboard shortcut (#12424)
authorMarkus Koivisto <markus@vaadin.com>
Thu, 24 Apr 2014 13:54:03 +0000 (16:54 +0300)
committerVaadin Code Review <review@vaadin.com>
Fri, 25 Apr 2014 14:10:24 +0000 (14:10 +0000)
commit6a67b0bf605ed1a17de48f3b355df398ed89a551
treec2a39bb60af1f218a63c32da97775163486e079a
parentf70a5674d99321fe173dddade28f7d913b9ac32c
Fix TextArea with enter keyboard shortcut (#12424)

When a keyboardshortcut has been added to anywhere on the page,
the previous behaviour would cause the keyboardshortcut event to
be processeed before the newline was processed. The end result
was that newlines were never added when typing in the TextArea.

Keyboard shortcuts operate on KeyDown events. By adding a listener
for these events and stopping their propagation when the ENTER key
is pressed, this unwanted behaviour can be averted, and the user
can enter multi-line text in a TextArea even when Enter is used as
a keyboard shortcut.

Obviously, this means that the keyboard shortcut will not work as
long as the TextArea widget has focus. This is the new intended
behaviour.

Change-Id: Ied438acb8589df498e5634271e486517bf6ac41e
client/src/com/vaadin/client/ui/VTextArea.java
uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java [new file with mode: 0644]