fix flicker bug for menus
This commit is contained in:
@@ -23,7 +23,7 @@ export const BubbleMenu: React.FC<BubbleMenuProps> = props => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={element} className={props.className}>
|
<div ref={element} className={props.className} style={{ visibility: 'hidden' }}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const FloatingMenu: React.FC<FloatingMenuProps> = props => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={element} className={props.className}>
|
<div ref={element} className={props.className} style={{ visibility: 'hidden' }}>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export const BubbleMenu = Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render(createElement) {
|
render(createElement) {
|
||||||
return createElement('div', {}, this.$slots.default)
|
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const FloatingMenu = Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render(createElement) {
|
render(createElement) {
|
||||||
return createElement('div', {}, this.$slots.default)
|
return createElement('div', { style: { visibility: 'hidden' } }, this.$slots.default)
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|||||||
@@ -42,6 +42,6 @@ export const BubbleMenu = defineComponent({
|
|||||||
editor.unregisterPlugin(BubbleMenuPluginKey)
|
editor.unregisterPlugin(BubbleMenuPluginKey)
|
||||||
})
|
})
|
||||||
|
|
||||||
return () => h('div', { ref: root }, slots.default?.())
|
return () => h('div', { ref: root, style: { visibility: 'hidden' } }, slots.default?.())
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,6 +36,6 @@ export const FloatingMenu = defineComponent({
|
|||||||
editor.unregisterPlugin(FloatingMenuPluginKey)
|
editor.unregisterPlugin(FloatingMenuPluginKey)
|
||||||
})
|
})
|
||||||
|
|
||||||
return () => h('div', { ref: root }, slots.default?.())
|
return () => h('div', { ref: root, style: { visibility: 'hidden' } }, slots.default?.())
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user