Skip to content
Permalink
Browse files

Implement Page(Up|Down) functionality for TextInput.

  • Loading branch information...
ema-fox committed Dec 6, 2014
1 parent 2ec16a0 commit f99c0e2c1538d3c6e4d857a2062e408905922207
Showing with 10 additions and 2 deletions.
  1. +10 −2 components/script/textinput.rs
@@ -163,9 +163,9 @@ impl TextInput {
self.edit_point.index = 0;
self.edit_point.line = 0;
return;
} else if adjust > 0 && self.edit_point.line >= self.lines.len() - adjust as uint {
self.edit_point.index = self.current_line_length();
} else if adjust > 0 && self.edit_point.line + adjust as uint >= self.lines.len() {
self.edit_point.line = self.lines.len() - 1;
self.edit_point.index = self.current_line_length();
return;
}

@@ -268,6 +268,14 @@ impl TextInput {
self.edit_point.index = self.current_line_length();
Nothing
}
"PageUp" => {
self.adjust_vertical(-28);
Nothing
}
"PageDown" => {
self.adjust_vertical(28);
Nothing
}
"Tab" => TriggerDefaultAction,
_ => Nothing,
}

0 comments on commit f99c0e2

Please sign in to comment.
You can’t perform that action at this time.