From 9a5984a110246039e702237ee1955526a0cb76c6 Mon Sep 17 00:00:00 2001 From: Ryan Castner Date: Thu, 14 Jun 2018 16:15:08 -0400 Subject: [PATCH 1/3] Add makeUnprivilegedEditor example to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 91301b75..8c371b55 100644 --- a/README.md +++ b/README.md @@ -679,6 +679,15 @@ class Editor extends React.Component { } ``` +To make an unprivileged editor instance use the ref to pass in the editor: + +```jsx +const editor = this.reactQuillRef.getEditor(); +const unprivilegedEditor = this.reactQuillRef.makeUnprivilegedEditor(editor); +// You may now use the unprivilegedEditor proxy methods +unprivilegedEditor.getText(); +``` + ### The unprivileged editor From 0cc2f771f86945a4f4641dac564a4e640ecc8ba7 Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Tue, 19 Jun 2018 10:59:42 -0700 Subject: [PATCH 2/3] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c371b55..620c7671 100644 --- a/README.md +++ b/README.md @@ -679,7 +679,15 @@ class Editor extends React.Component { } ``` -To make an unprivileged editor instance use the ref to pass in the editor: + + + +`makeUnprivilegedEditor` +: Creates an [unprivileged editor](#unprivileged-editor). Pass this method a reference to the Quill instance from `getEditor`. + + +
+Example ```jsx const editor = this.reactQuillRef.getEditor(); @@ -712,7 +720,6 @@ During events, ReactQuill will make a restricted subset of the Quill API availab `getBounds()` : Returns the pixel position, relative to the editor container, and dimensions, of a selection, at a given location. - ## Building and testing You can run the automated test suite: From 362d2b86407cefd9002c8793816f8ca39ad843bc Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Tue, 19 Jun 2018 11:03:08 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 620c7671..d8aab302 100644 --- a/README.md +++ b/README.md @@ -683,7 +683,7 @@ class Editor extends React.Component { `makeUnprivilegedEditor` -: Creates an [unprivileged editor](#unprivileged-editor). Pass this method a reference to the Quill instance from `getEditor`. +: Creates an [unprivileged editor](#unprivileged-editor). Pass this method a reference to the Quill instance from `getEditor`. Normally you do not need to use this method since the editor exposed to event handlers is already unprivileged.