Palette browser - fix bug when adding several blocks by ENTER
[scilab.git] / scilab / modules / xcos / src / java / org / scilab / modules / xcos / palette / listener / PaletteMouseListener.java
index c3f8172..5bcca07 100644 (file)
@@ -96,6 +96,11 @@ public final class PaletteMouseListener extends MouseAdapter {
     @Override
     public void mouseReleased(MouseEvent e) {
         super.mouseReleased(e);
-        ((PaletteView) e.getSource()).setSelectionRectangle(null);
+        PaletteView view = (PaletteView) e.getSource();
+        view.setSelectionRectangle(null);
+        Component[] blocks = view.getComponents();
+        if (blocks.length > 0) {
+            blocks[0].requestFocus();
+        }
     }
 }