File tree Expand file tree Collapse file tree
src/extensions/behavior/SelectionContext Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,16 +147,22 @@ class SelectionTooltip implements PluginSpec<PluginState> {
147147 const hideFromTr = pluginKey . getState ( view . state ) ?. disabled ;
148148
149149 // Don't show tooltip if editor not mounted to the DOM
150- // or when view is out of focus
151- if ( hideFromTr || ! view . dom . parentNode || ! view . hasFocus ( ) ) {
150+ if ( hideFromTr || ! view . dom . parentNode ) {
152151 this . tooltip . hide ( view ) ;
153152 return ;
154153 }
155154
156155 const { state} = view ;
157156 // Don't do anything if the document/selection didn't change
158- if ( prevState && prevState . doc . eq ( state . doc ) && prevState . selection . eq ( state . selection ) )
157+ if ( prevState && prevState . doc . eq ( state . doc ) && prevState . selection . eq ( state . selection ) ) {
159158 return ;
159+ }
160+
161+ // Don't show tooltip if editor out of focus
162+ if ( ! view . hasFocus ( ) ) {
163+ this . tooltip . hide ( view ) ;
164+ return ;
165+ }
160166
161167 const { selection} = state ;
162168 // Hide the tooltip if the selection is empty
You can’t perform that action at this time.
0 commit comments