@tiptap/suggestion
Advanced tools
Comparing version 2.0.0-beta.67 to 2.0.0-beta.68
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.68](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.67...@tiptap/suggestion@2.0.0-beta.68) (2021-08-23) | ||
### Bug Fixes | ||
* get correct clientRect when using async suggesteion items, fix [#1782](https://github.com/ueberdosis/tiptap/issues/1782) ([839acc1](https://github.com/ueberdosis/tiptap/commit/839acc1d9f713b89f366cd7da63330fd0243c31b)) | ||
# [2.0.0-beta.67](https://github.com/ueberdosis/tiptap/compare/@tiptap/suggestion@2.0.0-beta.66...@tiptap/suggestion@2.0.0-beta.67) (2021-08-23) | ||
@@ -8,0 +19,0 @@ |
@@ -105,3 +105,10 @@ 'use strict'; | ||
clientRect: decorationNode | ||
? () => decorationNode.getBoundingClientRect() | ||
? () => { | ||
var _a; | ||
// because of `items` can be asynchrounous we’ll search for the current docoration node | ||
const { decorationId } = (_a = this.key) === null || _a === void 0 ? void 0 : _a.getState(editor.state); | ||
const currentDecorationNode = document.querySelector(`[data-decoration-id="${decorationId}"]`); | ||
// @ts-ignore-error | ||
return currentDecorationNode.getBoundingClientRect(); | ||
} | ||
: null, | ||
@@ -108,0 +115,0 @@ }; |
@@ -101,3 +101,10 @@ import { PluginKey, Plugin } from 'prosemirror-state'; | ||
clientRect: decorationNode | ||
? () => decorationNode.getBoundingClientRect() | ||
? () => { | ||
var _a; | ||
// because of `items` can be asynchrounous we’ll search for the current docoration node | ||
const { decorationId } = (_a = this.key) === null || _a === void 0 ? void 0 : _a.getState(editor.state); | ||
const currentDecorationNode = document.querySelector(`[data-decoration-id="${decorationId}"]`); | ||
// @ts-ignore-error | ||
return currentDecorationNode.getBoundingClientRect(); | ||
} | ||
: null, | ||
@@ -104,0 +111,0 @@ }; |
@@ -104,3 +104,10 @@ (function (global, factory) { | ||
clientRect: decorationNode | ||
? () => decorationNode.getBoundingClientRect() | ||
? () => { | ||
var _a; | ||
// because of `items` can be asynchrounous we’ll search for the current docoration node | ||
const { decorationId } = (_a = this.key) === null || _a === void 0 ? void 0 : _a.getState(editor.state); | ||
const currentDecorationNode = document.querySelector(`[data-decoration-id="${decorationId}"]`); | ||
// @ts-ignore-error | ||
return currentDecorationNode.getBoundingClientRect(); | ||
} | ||
: null, | ||
@@ -107,0 +114,0 @@ }; |
{ | ||
"name": "@tiptap/suggestion", | ||
"description": "suggestion plugin for tiptap", | ||
"version": "2.0.0-beta.67", | ||
"version": "2.0.0-beta.68", | ||
"homepage": "https://tiptap.dev", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "5ee50917599866747b0ddffc89a5ef65a8987eca" | ||
"gitHead": "3664e3b1b0b14878d3dd2c59c9ba3024368b860a" | ||
} |
@@ -113,3 +113,10 @@ import { Editor, Range } from '@tiptap/core' | ||
clientRect: decorationNode | ||
? () => decorationNode.getBoundingClientRect() | ||
? () => { | ||
// because of `items` can be asynchrounous we’ll search for the current docoration node | ||
const { decorationId } = this.key?.getState(editor.state) | ||
const currentDecorationNode = document.querySelector(`[data-decoration-id="${decorationId}"]`) | ||
// @ts-ignore-error | ||
return currentDecorationNode.getBoundingClientRect() | ||
} | ||
: null, | ||
@@ -116,0 +123,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111604
983