aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
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.