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

Issue 796880 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

setSelectionRange scrolls the input out of view

Reported by jasonbio...@gmail.com, Dec 21 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

Steps to reproduce the problem:
1. Scroll to the bottom.
2. Click on "Select text".
3. Click again on "Select text".

What is the expected behavior?
The input should keep its position on the screen.

What went wrong?
The browser scrolls upwards, such that the input is not even on the screen anymore.

Did this work before? N/A 

Chrome version: 63.0.3239.108  Channel: stable
OS Version: 10.0
Flash Version: 

We cannot adjust the Javascript as it is written by a third-party library, nor can we adjust the width of the inputs as those are defined by our users.
A possibly-related issue (https://bugs.chromium.org/p/chromium/issues/detail?id=331233) describes how users may expect the input to shift the visible text such that the caret is visible. As we are uncertain whether the two issues are related, we decided to create a new issue.
 
Labels: Needs-Triage-M63
Cc: krajshree@chromium.org
Labels: Needs-Feedback Triaged-ET
Components: -Blink Blink>Scroll
jasonbiochem@ - Thanks for filing the issue...!!

Could you please provide a sample test file/url to test the issue from TE-end.
This will help us in triaging the issue further.

Thanks...!!
Sorry; here it is.
As mentioned in the file, the original reproduction can be found here: http://dojo.telerik.com/@ggkrustev/AkUtE
selection_scroll.html
723 bytes View Download
Project Member

Comment 5 by sheriffbot@chromium.org, Dec 22 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "krajshree@chromium.org" to the cc list and removing "Needs-Feedback" label.

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

Comment 6 by woxxom@gmail.com, Dec 22 2017

Bisect info: 441464 (good) - 441469 (bad)
https://chromium.googlesource.com/chromium/src/+log/0843b0c2..961e2d02?pretty=fuller
Suspecting r441469 = 961e2d024412588edffbef5b3f6dfdfd2646761f = https://crrev.com/2576963002 by sunyunjia@chromium.org
"Scroll the position into view when the content is not visible."
Landed in 57.0.2972.0
Merged to 56.0.2924.59
Able to reproduce the issue on reported version 63.0.3239.108 and latest canary 65.0.3304.0 using Windows-10, Ubuntu 14.04 and Mac 10.12.6 hence providing Bisect Info

Bisect Info:
================
Good build: 57.0.2971.0
Bad build: 57.0.2972.0

You are probably looking for a change made after 441468 (known good), but no later than 441469 (first known bad).

https://chromium.googlesource.com/chromium/src/+log/38c3c8c88851805c89a1953ee459c2350f7750f6..961e2d024412588edffbef5b3f6dfdfd2646761f

Reviewed-url: https://codereview.chromium.org/2576963002 

@sunyunjia: Please confirm the issue and help in re-assigning if it is not related to your change.

Thanks!
Cc: viswatej...@techmahindra.com sc00335...@techmahindra.com
Components: Blink>HTML>A
Labels: -Type-Bug -Pri-2 hasbisect-per-revision M-65 OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Owner: sunyunjia@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 9 by tkent@chromium.org, Jan 14 2018

Components: -Blink>HTML>A
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 17 2018

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

commit 7c1ceb980b168072487f7bd0a2c83194b195fccc
Author: Sandra Sun <sunyunjia@chromium.org>
Date: Wed Jan 17 05:48:01 2018

Do not scroll invisible selection into view.

When we call focus() on an <input> element, we would scroll the element
into view, then the selected text in it into view. However, if the
<input> element has a selection that is not currently visible, it will
first scroll the <input> into view, then try to scroll an empty
LayoutRect(0, 0, 0x0) into view, which might cause the <input> out of
view at last.

In this patch, we would check whether the selection's visible rect is
empty before scrolling it into view.

Bug:  796880 
Change-Id: Id5f7783a4efe137b180771280bd0c0c9dd1ab1ad
Reviewed-on: https://chromium-review.googlesource.com/854779
Commit-Queue: Sandra Sun <sunyunjia@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529638}
[add] https://crrev.com/7c1ceb980b168072487f7bd0a2c83194b195fccc/third_party/WebKit/LayoutTests/fast/scrolling/scroll-into-view-ignores-invisible-selection.html
[modify] https://crrev.com/7c1ceb980b168072487f7bd0a2c83194b195fccc/third_party/WebKit/Source/core/editing/FrameSelection.cpp

Status: Fixed (was: Assigned)
 Issue 817332  has been merged into this issue.

Sign in to add a comment