New issue
Advanced search Search tips

Issue 605492 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 2
Type: Bug



Sign in to add a comment

MacViews: Delete Word Forward and Delete Word Backward key bindings don't work correctly if there is an active selection.

Project Member Reported by karandeepb@chromium.org, Apr 21 2016

Issue description

Version: 52.0.2713.0
OS: Mac

What steps will reproduce the problem?
(1) Go to a MacViews textfield.
(2) Enter the text "Mac Views text"
(3) Select the words "Views text".
(4) Press keyboard shortcut for delete word backward. (Generally Option+Backspace). 

What is the expected output?
The final text should be "Mac " 

What do you see instead?
The final text is "".(empty string).

 
Labels: OS-Linux
This is also the behavior on Linux, although I am not sure regarding the expected behavior on Linux.
Project Member

Comment 2 by bugdroid1@chromium.org, May 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e739d04c25b6f63ac9fe7f70005268006f25868

commit 5e739d04c25b6f63ac9fe7f70005268006f25868
Author: karandeepb <karandeepb@chromium.org>
Date: Mon May 02 03:48:16 2016

Textfield: Move selection logic from GetCommandForKeyEvent to ExecuteCommand.

Currently, all logic related to an active selection, resides in
GetCommandForKeyEvent. This leads to  crbug.com/605492  on platforms like Linux
and Mac which may bypass GetCommandForKeyEvent.

This CL moves logic related to an active selection from GetCommandForKeyEvent to
ExecuteCommand. This also simplifies the logic in GetCommandForKeyEvent.

Also, this introduces some minor behavior changes on Windows-
-Ctrl+Shift+Delete(with selection) - used to be a IDS_APP_CUT operation earlier
but will now be resolved to a IDS_DELETE_FORWARD finally, similar to how
Ctrl+Shift+Backspace behaves.
-Shift+Delete(no selection) - used to be a IDS_DELETE_FORWARD operation earlier
but will now be resolved to a IDS_APP_CUT operation (and eventually a no-op,
since there is no active selection).

Also added a test "DeletionWithSelection" which fails on master for MacViews.

BUG= 605492 
TEST= On Linux and Mac, test that using a word delete keyboard shortcut in a
textfield with an active selection, deletes the selected text.

Review-Url: https://codereview.chromium.org/1923793002
Cr-Commit-Position: refs/heads/master@{#390888}

[modify] https://crrev.com/5e739d04c25b6f63ac9fe7f70005268006f25868/ui/views/controls/textfield/textfield.cc
[modify] https://crrev.com/5e739d04c25b6f63ac9fe7f70005268006f25868/ui/views/controls/textfield/textfield_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment