New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 615345 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 600416



Sign in to add a comment

Views Textfields: Inserted text is not selected on Undo.

Project Member Reported by karandeepb@chromium.org, May 27 2016

Issue description

Version: 53.0.2748.0
OS: All

What steps will reproduce the problem?
(1) Open bookmark bubble by clicking the star icon to the right of the address bar.
(2) Type "abcdef" in the Name: textfield.
(3) Select "def" and press Backspace.
(4) Press Ctrl+Z to undo.

What is the expected output?
The text should be "abcdef" with "def" selected. 

What do you see instead?
The text is "abcdef" with cursor after 'f'.

 
Cc: msw@chromium.org pkasting@chromium.org
I'll be working on a patch to fix this. I think the inserted text should be selected on undo on all platforms.

Also, can you confirm what should be the behavior for clients like Omnibox using the Textfield::SetText method. Currently on Undo, the cursor moves back to the recorded cursor position for these cases.

For example if the current text in the omnibox is - 
www.|google.com|
On pressing 'f', say it changes to-
www.f|acebook.com|.

Currently, on Undo, it becomes, 
www.|google.com

Shouldn't it instead have changed to 
www.|google.com|

Labels: -Pri-2 Pri-3
Undoing an action should restore whatever the selection was prior to the undone action.  So in the case of undoing a backspace as in comment 0, the restored text should be selected iff it was selected before pressing backspace.  Similarly with the case in comment 1.
Blocking: 600416
Owner: ----
Status: Available (was: Assigned)
Project Member

Comment 5 by sheriffbot@chromium.org, Mar 9 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by lgrey@chromium.org, Mar 29 2018

Labels: -Hotlist-Recharge-Cold MacViews-Browser Target-69 Proj-MacViews
Owner: lgrey@chromium.org
Status: Assigned (was: Untriaged)
I'll take this since we need it for MacViews

Comment 7 by lgrey@chromium.org, Mar 29 2018

Labels: -Pri-3 Pri-2

Comment 8 by gov...@chromium.org, Mar 29 2018

Labels: M-69
Owner: spqc...@chromium.org
Owner: tnijssen@google.com
Project Member

Comment 11 by bugdroid1@chromium.org, May 24 2018

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

commit 39f2467ad15b66d6e4dd1714f405d4aefa3c9aca
Author: Tessa Nijssen <tnijssen@google.com>
Date: Thu May 24 00:39:32 2018

[Views] Added Selection on Undo

Previously, after a section of text was removed and the removal was
undone, the cursor was placed after the text. The desired behavior
would be a selection of the re-placed text. This change saves the
current selection range on delete or replace. The selection range is
then restored on undo.

Changed tests:
  - TextfieldModelTest.UndoRedo_CutCopyPasteTest
  - OmniboxViewTest.UndoRedo
Added tests:
  - TextfieldModelTest.Undo_SelectionTest

Bug:  615345 
Change-Id: I9ce001099de7175da688a993ed3bfd29d296660c
Reviewed-on: https://chromium-review.googlesource.com/1066675
Commit-Queue: Tessa Nijssen <tnijssen@google.com>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Sarah Chan <spqchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561338}
[modify] https://crrev.com/39f2467ad15b66d6e4dd1714f405d4aefa3c9aca/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
[modify] https://crrev.com/39f2467ad15b66d6e4dd1714f405d4aefa3c9aca/ui/views/controls/textfield/textfield_model.cc
[modify] https://crrev.com/39f2467ad15b66d6e4dd1714f405d4aefa3c9aca/ui/views/controls/textfield/textfield_model.h
[modify] https://crrev.com/39f2467ad15b66d6e4dd1714f405d4aefa3c9aca/ui/views/controls/textfield/textfield_model_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment