Skip to content

Attempts to provide missing ShadowRoot.getSelection implementation in Firefox / Safari.

Notifications You must be signed in to change notification settings

jsturgill/shadow-root-get-selection-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShadowRoot.getSelection Polyfill

Provides missing ShadowRoot.getSelection implementation in Firefox.

The fix was sparked by an attempt to solve an issue with prosemirror in Shadow Dom and was inspired by changes made to support Shadow DOM in quilljs.

Safari hasn't moved on this for 2 years, and the GoogleChromeLabs polyfill doesn't actually address the problem.

The polyfill is likely not to work on Safari, but the patch will still be applied if the method is called.

Installation

npm install shadow-root-get-selection-polyfill

or

yarn add shadow-root-get-selection-polyfill

Usage

import { patch } from 'shadow-root-get-selection-polyfill';
patch();

About

Attempts to provide missing ShadowRoot.getSelection implementation in Firefox / Safari.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published