New issue
Advanced search Search tips

Issue 719430 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Compat



Sign in to add a comment

Behavior of click after below the selection at end

Reported by k.krz...@cksource.com, May 8 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce the problem:
1. Go to https://codepen.io/f1ames/pen/wdpwrq.
2. Select text like [World 2!] (selection should include end of the text).
3. Click somewhere below text (outside the body element).
4. Press any key.

What is the expected behavior?
The `keydown` listener attached to the `body` element is not fired.

What went wrong?
The `keydown` listener attached to the `body` element is fired.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.81  Channel: stable
OS Version: OS X 10.11.6
Flash Version: 

This issue is more complex than simple listener behaviour. I checked how it works in other browsers - FF (53.0.2 (64-bit)), Safari (Version 10.0.1 (11602.2.14.0.7)), IE11.

In FF and Safari while performing step 3 (clicking outside of the body) the selection changes from the non-collapsed to collapsed and is placed at the end of the line like `Hello World 2!^` so you cannot "get outside" of the body element. In IE11, the selection disappears (is placed outside of the body) same as in Chrome, but the `keydown` listener is not fired on keypress.

-----

It only happens for selection on the on of the text. If the selection is placed in the middle of the text, after clicking outside of the body it is placed as collapsed selection at the text end. It seems the most preferable behaviour would be the same as in FF and Safari so that the selection stays on the end of the text.
 
One small typo in the last paragraph:
It only happens for selection on the END of the text.
Status: Untriaged (was: Unconfirmed)
Confirmed with Mac Canary 60.0.3093.0, but not sure what should be the correct behavior...

In step 3, the clicked position is considered as outside the <body> but still in the <html>, which is clear from the inspector.

Hence, step 3 only clears the selection, but the focus still remains in the document. That's the reason why body still receives the event.

Comment 3 by yosin@chromium.org, May 9 2017

Labels: -Type-Bug Type-Compat
Status: WontFix (was: Untriaged)
Summary: Behavior of click after below the selection at end (was: Keydown listener attached to editable body fired event when keydown performed outside of the body element.)
Height of BODY element is as same as the page. So, clicking below the last line is still considered
as clicking BODY element.

BTW, on sample of #c1, clicking after selection at end of editable, each browser behaves 
differently:

Chrome: Clear selection
Edge: Paint selection with gray instead of blue
Firefox: Collapse selection somewhere in last line at same x-point where clicked.

Sign in to add a comment