summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/views/controls/textfield/native_textfield_views.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index 746d2d4..c5b27a4 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -961,6 +961,11 @@ bool NativeTextfieldViews::HandleKeyEvent(const KeyEvent& key_event) {
break;
case ui::VKEY_RIGHT:
case ui::VKEY_LEFT:
+ // We should ignore the alt-left/right keys because alt key doesn't make
+ // any special effects for them and they can be shortcut keys such like
+ // forward/back of the browser history.
+ if (key_event.IsAltDown())
+ break;
model_->MoveCursor(
control ? gfx::WORD_BREAK : gfx::CHARACTER_BREAK,
(key_code == ui::VKEY_RIGHT) ? gfx::CURSOR_RIGHT : gfx::CURSOR_LEFT,