File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -815,7 +815,7 @@ def removeSelected(self):
815815 selected = self .scene ().selectedItems ()
816816 if not selected :
817817 return
818-
818+ scene = self . scene ()
819819 self .__undoStack .beginMacro (self .tr ("Remove" ))
820820 for item in selected :
821821 if isinstance (item , items .NodeItem ):
@@ -824,6 +824,9 @@ def removeSelected(self):
824824 commands .RemoveNodeCommand (self .__scheme , node )
825825 )
826826 elif isinstance (item , items .annotationitem .Annotation ):
827+ if item .hasFocus () or item .isAncestorOf (scene .focusItem ()):
828+ # Clear input focus from the item to be removed.
829+ scene .focusItem ().clearFocus ()
827830 annot = self .scene ().annotation_for_item (item )
828831 self .__undoStack .push (
829832 commands .RemoveAnnotationCommand (self .__scheme , annot )
You can’t perform that action at this time.
0 commit comments