aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-08-15 05:06:21 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-08-18 18:37:12 +0530
commitac1b7a3896c5e05d9ae0af71fc3c82e73c9a05f4 (patch)
tree4b0bcb057a3322fc2191163af5a6f3d41df3d407 /components/script/textinput.rs
parent53e155e8ac62c4ce2f2e2bd930b15ecebd41465e (diff)
downloadservo-ac1b7a3896c5e05d9ae0af71fc3c82e73c9a05f4.tar.gz
servo-ac1b7a3896c5e05d9ae0af71fc3c82e73c9a05f4.zip
Cleanup textinput, timers
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r--components/script/textinput.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index 31fc7dc2e25..5ecf6a4f312 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -292,10 +292,11 @@ impl<T: ClipboardProvider> TextInput<T> {
/// Deal with a newline input.
pub fn handle_return(&mut self) -> KeyReaction {
if !self.multiline {
- return KeyReaction::TriggerDefaultAction;
+ KeyReaction::TriggerDefaultAction
+ } else {
+ self.insert_char('\n');
+ KeyReaction::DispatchInput
}
- self.insert_char('\n');
- return KeyReaction::DispatchInput;
}
/// Select all text in the input control.