fix tippy for suggestions

This commit is contained in:
Philipp Kühn 2019-04-11 20:13:52 +02:00
parent 03cb2a1cce
commit d8f62f010a

View File

@ -159,6 +159,7 @@ export default {
filteredUsers: [],
navigatedUserIndex: 0,
insertMention: () => {},
observer: null,
}
},
@ -222,20 +223,35 @@ export default {
interactive: true,
theme: 'dark',
placement: 'top-start',
performance: true,
inertia: true,
duration: [400, 200],
showOnInit: true,
arrow: true,
arrowType: 'round',
})
// we have to update tippy whenever the DOM is updated
if (MutationObserver) {
this.observer = new MutationObserver(() => {
this.popup.popperInstance.scheduleUpdate()
})
this.observer.observe(this.$refs.suggestions, {
childList: true,
subtree: true,
characterData: true,
})
}
},
destroyPopup() {
if (this.popup) {
this.popup.destroyAll()
this.popup.destroy()
this.popup = null
}
if (this.observer) {
this.observer.disconnect()
}
},
},
@ -244,7 +260,6 @@ export default {
<style lang="scss">
@import "~variables";
@import '~modules/tippy.js/dist/tippy.css';
.mention {
background: rgba($color-black, 0.1);