fix flicker bug for menus

This commit is contained in:
Philipp Kühn 2021-04-01 17:55:32 +02:00
parent 3b3a0103b9
commit 4d4f96bfc0
6 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ export const BubbleMenu: React.FC<BubbleMenuProps> = props => {
}, [])
return (
<div ref={element} className={props.className}>
<div ref={element} className={props.className} style={{ visibility: 'hidden' }}>
{props.children}
</div>
)

View File

@ -22,7 +22,7 @@ export const FloatingMenu: React.FC<FloatingMenuProps> = props => {
}, [])
return (
<div ref={element} className={props.className}>
<div ref={element} className={props.className} style={{ visibility: 'hidden' }}>
{props.children}
</div>
)

View File

@ -36,7 +36,7 @@ export const BubbleMenu = Vue.extend({
},
render(createElement) {
return createElement('div', {}, this.$slots.default)
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)
},
beforeDestroy() {

View File

@ -30,7 +30,7 @@ export const FloatingMenu = Vue.extend({
},
render(createElement) {
return createElement('div', {}, this.$slots.default)
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)
},
beforeDestroy() {

View File

@ -42,6 +42,6 @@ export const BubbleMenu = defineComponent({
editor.unregisterPlugin(BubbleMenuPluginKey)
})
return () => h('div', { ref: root }, slots.default?.())
return () => h('div', { ref: root, style: { visibility: 'hidden' } }, slots.default?.())
},
})

View File

@ -36,6 +36,6 @@ export const FloatingMenu = defineComponent({
editor.unregisterPlugin(FloatingMenuPluginKey)
})
return () => h('div', { ref: root }, slots.default?.())
return () => h('div', { ref: root, style: { visibility: 'hidden' } }, slots.default?.())
},
})