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

Issue 886615 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Sep 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Regression:Unwanted text selection is seen on 'Person' name in add person overlay.

Reported by shruti.j...@etouch.net, Sep 19

Issue description

Chrome Version: 71.0.3556.0 (Official Build) Revision	bd6b4db905b5d51ca0ab759729efca79bc0a6046-refs/branch-heads/3556@{#1} (32/64-bit)
OS: Windows(7,8,8.1,10), Mac(10.12.6, 10.13.1, 10.13.6, 10.14) and Linux(14.04 LTs).

Steps to reproduce:
1.Launch chrome and click on avatar .
2.Select 'Manage People' ,Click on 'Add Person'.
3.Observe the 'Person' name.

Actual Result:Unwanted text selection is seen on 'Person' name in add person overlay.
Expected Result: No such text selection should be seen on 'Person' name in add person overlay.

This is a regression issue broken in ‘M-71’ and below is the 'per-revision' bisect information:
Good Build : 71.0.3549.0 (Revision : 590120)
Bad Build : 71.0.3550.0 (Revision : 590498)

You are probably looking for a change made after 590356 (known good), but no later than 590357 (first known bad).
CHANGE-LOG URL:

The script might not always return single CL as suspect as some perf builds might get missing due to failure.
  https://chromium.googlesource.com/chromium/src/+log/6bfb8aecf494876d0a2ce903d51dc18089ecdf79..54a733daaab037e63fe5474be68c6e5877c9c670

Suspect:https://chromium.googlesource.com/chromium/src/+/54a733daaab037e63fe5474be68c6e5877c9c670

@Steven Bennetts : Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Kindly refer the attached screen-cast.

Thank you..!
 
Actual_Result.mp4
207 KB View Download
Expected_Result.mp4
214 KB View Download
Cc: sgabr...@chromium.org hcarmona@chromium.org dpa...@chromium.org
The new behavior is normal / expected for text input.

hcarmona@ / dpapad@ / sgabriel@ - Can you think of any reason why we might not want this behavior here (and possibly elsewhere)? I think it makes the focused UI more obvious, and it's one less keystroke or double-click for the user to overwrite the default / placeholder name.


@stevenjb: Observing how a native <input> behaves I see the following (example at https://jsfiddle.net/c1u65tmr/1/):

1) Auto selects the text if the user focuses it via the Tab key.
2) Does not auto select if the user focuses by click.
3) Does not auto select if focus() is called programmatically.

Having similar behavior with cr-input seems reasonable. IIUC, the case here is that #3 behaves differently among native and cr-input?
3) Is actually a bit less straightforward. If you tab into the 1st input (selecting the text), or select any part of the text, then click 'focus 1st input problematically', then the text is selected.

I'll need to do some experimentation to see how cr-input behaves. Matching the <input> behavior exactly might be more of a PITA than it's worth.

sgabriel@, do you have an opinion about which behavior from the initial description is preferred, 'actual' or 'expected'?

Cc: scottchen@chromium.org
Labels: -Pri-1 Pri-2
+scottchen

>  If you tab into the 1st input (selecting the text), or select any part of the text, then click 'focus 1st input problematically', then the text is selected.

If the 1st input is focused, and the button is clicked, I see the selection being preserved. Is that what you are also describing?

Either way, I don't think this needs to be a P1 bug, and also maybe scottchen@ can comment on whether we need to do anything special about cr-input's focus. IIUC, it should delegate focus to the inner native <input>, and we should be getting most (if not all) of the same functionality for free.
re #3. In this specific case "actual" is better as it enables the user to quickly modify the name.
Can someone clarify if clicking any cr-input now automatically selects the text?

Native <input> prioritizes the "append text" case, and does not auto select the text. Chrome's omnibox on the other hand prioritizes the "replace text" case and auto selects the text.

Having all our cr-inputs priortizing the "replace text" case does not seem optimal to me (again this depends on the answer to my 1st question).

If this is only affecting the Person input, then I don't have strong preference one way or the other.
stevenjb@ I think having mouse-click focus select text is more "unexpected", than tab & shift-tab behaving differently, so maybe we should revert the cr-input change in https://chromium-review.googlesource.com/c/chromium/src/+/1217747.

Or, we could detect whether the focus comes from mouse or keyboard, and don't select text if focus comes from mouse.

I think the most tricky might be "do not select text when programatically called .focus()", because we're mimicking some keyboard-focus by actually programatically focusing in order to work around some weird tab-index-with-shadow-dom issue, but it might be okay if we let programmatic .focus() calls select text, as long as we fix it for the mouse-click case.
Status: WontFix (was: Assigned)
Let's step back, I think there is some confusion here.

*clicking* in <cr-input> field does not select anything in any case as far as I am aware. (i.e. it has the expected behavior of de-selecting anything and setting the cursor position, same as with <input>).

The *programatic* focus() behavior for <input> appears to have no affect on the selection, i.e. if the text was selected previously (e.g. with tab focus), then focus() will show the text as selected. If not, it will stay unselected. That is what I was trying to describe in comment #3. Note: It doesn't prioritize "append", if anything it prioritizes "prepend", which doesn't seem very useful to me.

The *programatic* focus() behavior for <cr-input> is unknown (setting up a test is not completely trivial), but I suspect that it currently behaves the same tab-focus, i.e. we always select the contents of the field.

This is unlikely to be common. It will only occur when the default focused (i.e. first) field of a page or dialog is an editable text field that is already populated with content (e.g. the 'add person' overlay).

Given that sgabriel@ prefers the current behavior in this case, I am going to mark this as WontFix, and if we encounter another instance where the behavior is undesirable, we can either fix that example or modify cr-input behavior.

Sign in to add a comment