mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-25 12:39:03 +08:00
feat: remove keepInBounds
This commit is contained in:
parent
9335858392
commit
d7282f168b
@ -6,7 +6,6 @@ import tippy from 'tippy.js'
|
||||
export interface BubbleMenuPluginProps {
|
||||
editor: Editor,
|
||||
element: HTMLElement,
|
||||
keepInBounds: boolean,
|
||||
}
|
||||
|
||||
export type BubbleMenuViewProps = BubbleMenuPluginProps & {
|
||||
|
@ -10,7 +10,6 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||
|
||||
defaultOptions: {
|
||||
element: null,
|
||||
keepInBounds: true,
|
||||
},
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
@ -22,7 +21,6 @@ export const BubbleMenu = Extension.create<BubbleMenuOptions>({
|
||||
BubbleMenuPlugin({
|
||||
editor: this.editor,
|
||||
element: this.options.element,
|
||||
keepInBounds: this.options.keepInBounds,
|
||||
}),
|
||||
]
|
||||
},
|
||||
|
@ -9,12 +9,11 @@ export const BubbleMenu: React.FC<BubbleMenuProps> = props => {
|
||||
const element = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const { editor, keepInBounds = true } = props
|
||||
const { editor } = props
|
||||
|
||||
editor.registerPlugin(BubbleMenuPlugin({
|
||||
editor,
|
||||
element: element.current as HTMLElement,
|
||||
keepInBounds,
|
||||
}))
|
||||
|
||||
return () => {
|
||||
|
@ -9,11 +9,6 @@ export const BubbleMenu = Vue.extend({
|
||||
type: Object as PropType<BubbleMenuPluginProps['editor']>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
keepInBounds: {
|
||||
type: Boolean as PropType<BubbleMenuPluginProps['keepInBounds']>,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
@ -28,7 +23,6 @@ export const BubbleMenu = Vue.extend({
|
||||
editor.registerPlugin(BubbleMenuPlugin({
|
||||
editor,
|
||||
element: this.$el as HTMLElement,
|
||||
keepInBounds: this.keepInBounds,
|
||||
}))
|
||||
})
|
||||
},
|
||||
|
@ -20,21 +20,15 @@ export const BubbleMenu = defineComponent({
|
||||
type: Object as PropType<BubbleMenuPluginProps['editor']>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
keepInBounds: {
|
||||
type: Boolean as PropType<BubbleMenuPluginProps['keepInBounds']>,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup({ editor, keepInBounds }, { slots }) {
|
||||
setup({ editor }, { slots }) {
|
||||
const root = ref<HTMLElement | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
editor.registerPlugin(BubbleMenuPlugin({
|
||||
editor,
|
||||
element: root.value as HTMLElement,
|
||||
keepInBounds,
|
||||
}))
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user