make tippy update itself when content changes via sticky plugin

This commit is contained in:
Gregor Weichbrodt 2020-04-05 14:13:37 +02:00
parent cf5dc9685b
commit abecec452c

View File

@ -35,7 +35,7 @@
<script>
import Fuse from 'fuse.js'
import tippy, { roundArrow } from 'tippy.js'
import tippy, { roundArrow, sticky } from 'tippy.js'
import Icon from 'Components/Icon'
import { Editor, EditorContent, EditorMenuBar } from 'tiptap'
import {
@ -219,11 +219,12 @@ export default {
// ref: https://atomiks.github.io/tippyjs/v6/all-props/
this.popup = tippy('.page', {
// function that returns a ClientRect object
getReferenceClientRect: node.getBoundingClientRect,
appendTo: () => document.body,
interactive: true,
arrow: roundArrow,
sticky: true, // make sure position of tippy is updated when content changes
plugins: [sticky],
content: this.$refs.suggestions,
trigger: 'mouseenter', // manual
showOnCreate: true,