.focus() on shadow focusable prevents text selection
Reported by
plato...@gmail.com,
Oct 5 2017
|
|||||||
Issue descriptionChrome Version : 61.0.3163.91 OS Version: OS X 10.12.6 URLs (if applicable) : http://jsbin.com/foxuyesela/edit?html,output Other browsers tested: Add OK or FAIL after other browsers where you have tested this issue: Safari 11: OK What steps will reproduce the problem? 1. Open JSbin: http://jsbin.com/foxuyesela/edit?html,output 2. Try to start selecting some text with mouse on the words “Try to start a selection here”. What is the expected result? Mouse text selection works. What happens instead of that? Mouse text selection does not work. Please provide any additional information below. Attach a screenshot if possible. This seems to be related with Shadow DOM. Motivation behind using manual `focus()`: by default with Shadow DOM, mousedown on a slotted element does not focus the focusable shadow slot wrapper, while we need focus on mousedown there for our use case. (I consider this as a feature, since focus does not happen both in Safari and Chrome in this case.) When trying to workaround the lack of mousedown focus, I call `focus()` manually, and this causes the subject issue. UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36
,
Oct 11 2017
The issue implies using native Shadow DOM v1. As far as I know, Shadow DOM v1 support was first introduced in Chrome 53. Therefore it does not really make sense to try anything older. The exact behaviour of the demo in the browsers lacking native Shadow DOM v1 support does not matter. Currently I do not see any errors in the demo itself to fix. I have tried this demo with different native Shadow DOM v1 implementation in Safari 11, it works as expected there.
,
Oct 11 2017
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 11 2017
Please note that, as of this moment, JSbin seems to be temporarily out of service. It does not even start a new bin for me. This might be a reason why the JSbin demo is not working in some Chrome versions for you as well.
,
Oct 12 2017
Since the test file for this is no longer working to repro the issue and as per Comment#2 this seems to be happening since in Chrome 53 when Shadow DOM v1 support was first introduced. Adding proper component and cc'ing devs @hayato and @kochi for more inputs on this.
,
Oct 12 2017
As JSbin is down, I have created a repro in JSfiddle as well: https://jsfiddle.net/fLuznvv7/1/
,
Oct 13 2017
This seems editing selection issue. Yoichi, could you take a look?
,
Oct 13 2017
Able to reproduce this issue on reported version 61.0.3163.91 and latest Canary 63.0.3238.0 using Win 10, Ubuntu 14.04 and Mac 10.12.6 Bisect Information: ==================== Good build: 60.0.3104.0 -Revision :473014 Bad Build: 60.0.3105.0 -Revision:473393 Unable to perform per-revision bisect on M60, hence providing chromium bisect changelog You are probably looking for a change made after 473127 (known good), but no later than 473131 (first known bad). CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/dac8e43d7961d3bd5d4db36b191aecd64e0979c9..99c24962dc687afd137ce69f7efb0a4ae1367301 Suspecting: https://codereview.chromium.org/2891693002 @yosin: 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. Thanks!
,
Oct 13 2017
,
Oct 16 2017
Mark WontFix since this is expected behavior. To set focus into distributed element, please add tabindex="0" to distributed element, in the sample in #c1: <my-container> <div tabindex="0">Slotted element. Try to start a selection here.</div> _______^^^^^^^^^^^^ </my-container> In the sample #c1, default event handler of "mousedown" set focus to BODY then JS timer attempts to set focus to |focusable| and cancel mouse dragging since active element is moved. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by vamshi.k...@techmahindra.com
, Oct 11 2017Labels: Needs-Bisect Needs-Feedback Triaged-ET