mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 18:49:02 +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>
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user