File tree Expand file tree Collapse file tree
packages/editor/src/core/extensions/slash-commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ const Command = Extension.create<SlashCommandOptions>({
5353
5454 return {
5555 onStart : ( props ) => {
56+ // Track active dropdown
57+ props . editor . commands . addActiveDropbarExtension ( CORE_EXTENSIONS . SLASH_COMMANDS ) ;
5658 component = new ReactRenderer < CommandListInstance , SlashCommandsMenuProps > ( SlashCommandsMenu , {
5759 props,
5860 editor : props . editor ,
@@ -65,7 +67,7 @@ const Command = Extension.create<SlashCommandOptions>({
6567 const element = component . element as HTMLElement ;
6668 element . style . position = "absolute" ;
6769 element . style . zIndex = "100" ;
68- ( props . editor . options . element || document . body ) . appendChild ( element ) ;
70+ document . body . appendChild ( element ) ;
6971
7072 updateFloatingUIFloaterPosition ( props . editor , element ) ;
7173 } ,
@@ -93,7 +95,9 @@ const Command = Extension.create<SlashCommandOptions>({
9395 return component ?. ref ?. onKeyDown ( props ) ?? false ;
9496 } ,
9597
96- onExit : ( ) => {
98+ onExit : ( { editor } ) => {
99+ // Remove from active dropdowns
100+ editor ?. commands . removeActiveDropbarExtension ( CORE_EXTENSIONS . SLASH_COMMANDS ) ;
97101 component ?. destroy ( ) ;
98102 component = null ;
99103 } ,
You can’t perform that action at this time.
0 commit comments