@bbl-digital/snorre 4.1.8 → 4.1.10

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -35576,11 +35576,6 @@ to {top: 100vh;}
35576
35576
  editorActual.setAttribute('id', id || 'ql-editor');
35577
35577
  editorActual.setAttribute('name', name || 'ql-editor');
35578
35578
  }
35579
- quillInstance.root.addEventListener('blur', e => {
35580
- e.preventDefault();
35581
- const html = quillInstance.root.innerHTML;
35582
- onBlur && onBlur(html);
35583
- });
35584
35579
  quillInstance.keyboard.addBinding({
35585
35580
  key: 'Backspace'
35586
35581
  }, {
@@ -35611,6 +35606,19 @@ to {top: 100vh;}
35611
35606
  setQuill(quillInstance);
35612
35607
  }
35613
35608
  }, []);
35609
+ React.useEffect(() => {
35610
+ if (!quill) return;
35611
+ quill.root.addEventListener('blur', e => {
35612
+ const html = quill.root.innerHTML;
35613
+ onBlur && onBlur(html);
35614
+ });
35615
+ return () => {
35616
+ quill.root.removeEventListener('blur', e => {
35617
+ const html = quill.root.innerHTML;
35618
+ onBlur && onBlur(html);
35619
+ });
35620
+ };
35621
+ }, [quill]);
35614
35622
  React.useEffect(() => {
35615
35623
  if (!quill) return;
35616
35624
  quill.on('selection-change', (range, oldRange, source) => {
@@ -173,11 +173,6 @@ const QuillEditor = ({
173
173
  editorActual.setAttribute('id', id || 'ql-editor');
174
174
  editorActual.setAttribute('name', name || 'ql-editor');
175
175
  }
176
- quillInstance.root.addEventListener('blur', e => {
177
- e.preventDefault();
178
- const html = quillInstance.root.innerHTML;
179
- onBlur && onBlur(html);
180
- });
181
176
  quillInstance.keyboard.addBinding({
182
177
  key: 'Backspace'
183
178
  }, {
@@ -208,6 +203,19 @@ const QuillEditor = ({
208
203
  setQuill(quillInstance);
209
204
  }
210
205
  }, []);
206
+ useEffect(() => {
207
+ if (!quill) return;
208
+ quill.root.addEventListener('blur', e => {
209
+ const html = quill.root.innerHTML;
210
+ onBlur && onBlur(html);
211
+ });
212
+ return () => {
213
+ quill.root.removeEventListener('blur', e => {
214
+ const html = quill.root.innerHTML;
215
+ onBlur && onBlur(html);
216
+ });
217
+ };
218
+ }, [quill]);
211
219
  useEffect(() => {
212
220
  if (!quill) return;
213
221
  quill.on('selection-change', (range, oldRange, source) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0Q3C,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/QuillEditor/index.tsx"],"names":[],"mappings":"AAGA,OAAO,2BAA2B,CAAA;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+D3C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkR3C,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -173,11 +173,6 @@ const QuillEditor = ({
173
173
  editorActual.setAttribute('id', id || 'ql-editor');
174
174
  editorActual.setAttribute('name', name || 'ql-editor');
175
175
  }
176
- quillInstance.root.addEventListener('blur', e => {
177
- e.preventDefault();
178
- const html = quillInstance.root.innerHTML;
179
- onBlur && onBlur(html);
180
- });
181
176
  quillInstance.keyboard.addBinding({
182
177
  key: 'Backspace'
183
178
  }, {
@@ -208,6 +203,19 @@ const QuillEditor = ({
208
203
  setQuill(quillInstance);
209
204
  }
210
205
  }, []);
206
+ useEffect(() => {
207
+ if (!quill) return;
208
+ quill.root.addEventListener('blur', e => {
209
+ const html = quill.root.innerHTML;
210
+ onBlur && onBlur(html);
211
+ });
212
+ return () => {
213
+ quill.root.removeEventListener('blur', e => {
214
+ const html = quill.root.innerHTML;
215
+ onBlur && onBlur(html);
216
+ });
217
+ };
218
+ }, [quill]);
211
219
  useEffect(() => {
212
220
  if (!quill) return;
213
221
  quill.on('selection-change', (range, oldRange, source) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "4.1.8",
3
+ "version": "4.1.10",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",