quill
quill copied to clipboard
Shadow DOM support and tests
Rebased the work from #1805 on top of the 1.3.6
Submitting this PR to check if the tests pass
Tests are failing in Safari because not implemented getSelection() API.
Potential fix would be using https://github.com/GoogleChromeLabs/shadow-selection-polyfill
Shadow selection polyfill does not work properly because of this line: https://github.com/quilljs/quill/blob/96e38e92637b75b907579d0cc1b201920aebe38c/core/selection.js#L32
See the listener in the polyfill where setTimeout is also used and the timeout is 0: https://github.com/GoogleChromeLabs/shadow-selection-polyfill/blob/9eff233c765a685bbf488b2f8eba0d3d75f44cbd/shadow.js#L74
What's the progress on this issue? I tried using quill on a polymer project a couple of months ago and unfortunately I was not able to get it to work. :(
Is there anything I can do to help? I really look forward to using quill in my projects!
EDIT: I just noticed #1805, I'll take a look and hopefully take a shot at helping out.
Is this support for Shadow DOM still actively worked on? I see #1805 has also been open for a while.
Note, the polyfill for Safari added in this PR mostly works but is not quite stable (as we have observed various issues with Quill which it introduces).
Furthermore, the selection API has to be changed so that there will be getComposedRange() method in future (at least there seems to be a consensus): https://github.com/w3c/selection-api/issues/98
@web-padawan -- I need to get this working yesterday. And I'd like to spend some time on it.
- What issues do you see in Safari?
- What are the state of the tests in here failing?
- Do you have any sense of the roadmap for getting this PR to work?
Thanks
@DeadWisdom the problem is described here https://github.com/webcomponents/polyfills/issues/66#issuecomment-427066346
In our project, we ended up using a fork with custom build, source is here: https://github.com/web-padawan/quill/commits/vaadin-quill
That branch is derived from 1.3.6 Quill version, so porting it to master might be untrivial.
Also, it contains some tweaks which we only need for our project.
The commits below are especially targeting the issue in Safari, so you should be able to apply these patches on top of 1.3.6 branch yourself, in the following order:
web-padawan/quill@21868969cd00434d02eeedb1fae3f0b2a3af0366
web-padawan/quill@31253d6a7fab84a429490c27315abadfbc256ca9
web-padawan/quill@5331cb2ff58c37490e9d8ffe068266653cc03871
web-padawan/quill@56a960efe59068c17aff25f3ad7f2b55177213c8
web-padawan/quill@95b8374ff45c7200e8d1d2f5e1ca8e5d6c94431d
Note, the polyfill used by our project is not official, neither 100% tested. We consider it "good enough" to make Quill work in Shadow DOM in Safari but some edge cases will occur.
Thank you very much @web-padawan for your work on this. I've been given a small sandbox of time to get this done. So we'll see what I can do.
@DeadWisdom updates?
Ping? Anything we can do to get this merged?
I ended up working on this problem elsewhere, one thing missing from this PR is properly handling the document.activeElement reference in the bubble theme.
It's almost 2023? any updates on support or a forked latest npm package etc?