Behavior of click after below the selection at end
Reported by
k.krz...@cksource.com,
May 8 2017
|
|||
Issue descriptionUserAgent: 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.
,
May 8 2017
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.
,
May 9 2017
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 |
|||
Comment 1 by k.krz...@cksource.com
, May 8 2017