mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-06 02:17:49 +08:00
make tippy update itself when content changes via sticky plugin
This commit is contained in:
parent
cf5dc9685b
commit
abecec452c
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Fuse from 'fuse.js'
|
import Fuse from 'fuse.js'
|
||||||
import tippy, { roundArrow } from 'tippy.js'
|
import tippy, { roundArrow, sticky } from 'tippy.js'
|
||||||
import Icon from 'Components/Icon'
|
import Icon from 'Components/Icon'
|
||||||
import { Editor, EditorContent, EditorMenuBar } from 'tiptap'
|
import { Editor, EditorContent, EditorMenuBar } from 'tiptap'
|
||||||
import {
|
import {
|
||||||
@ -219,11 +219,12 @@ export default {
|
|||||||
|
|
||||||
// ref: https://atomiks.github.io/tippyjs/v6/all-props/
|
// ref: https://atomiks.github.io/tippyjs/v6/all-props/
|
||||||
this.popup = tippy('.page', {
|
this.popup = tippy('.page', {
|
||||||
// function that returns a ClientRect object
|
|
||||||
getReferenceClientRect: node.getBoundingClientRect,
|
getReferenceClientRect: node.getBoundingClientRect,
|
||||||
appendTo: () => document.body,
|
appendTo: () => document.body,
|
||||||
interactive: true,
|
interactive: true,
|
||||||
arrow: roundArrow,
|
arrow: roundArrow,
|
||||||
|
sticky: true, // make sure position of tippy is updated when content changes
|
||||||
|
plugins: [sticky],
|
||||||
content: this.$refs.suggestions,
|
content: this.$refs.suggestions,
|
||||||
trigger: 'mouseenter', // manual
|
trigger: 'mouseenter', // manual
|
||||||
showOnCreate: true,
|
showOnCreate: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user