-
Bug
-
Resolution: Won't Fix
-
P3
-
8u40
-
MacOSX 10.9.5
Embedded mode in Safari 7.1.3 (always)
and Firefox 31.0 (sometimes)
Seen on MacOSX with Safari/Firefox in embedded mode:
When the mouse moves within the popup of a ComboBox, the nodes/elements underneath that popup still receive MouseEvents (mouse_move, mouse_entered, mouse_exited).
When running the attached example application as standalone everything is fine, the effect only appears when running the code in a browser. Try hovering the red area first, then open the comboBox and hover the popup.
Example:
package application;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
VBox root = new VBox(5);
Label label = new Label();
root.getChildren().add(label);
ComboBox<String> cb = new ComboBox<String>();
cb.getItems().add("Item 1");
cb.getItems().add("Item 2");
cb.getItems().add("Item 3");
cb.getItems().add("Item 4");
cb.getItems().add("Item 5");
cb.getSelectionModel().select(0);
cb.setTranslateX(50);
root.getChildren().add(cb);
Rectangle rect = new Rectangle(80, 150);
rect.setFill(Paint.valueOf("red"));
rect.setOnMouseEntered(enter -> {
rect.setFill(Paint.valueOf("green"));
});
rect.setOnMouseExited(exit -> {
rect.setFill(Paint.valueOf("red"));
});
rect.setOnMouseMoved((event) -> {
label.setText("Event sceneXY: " + event.getSceneX() + "/" + event.getSceneY());
});
root.getChildren().add(rect);
Scene scene = new Scene(root,200,200);
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
When the mouse moves within the popup of a ComboBox, the nodes/elements underneath that popup still receive MouseEvents (mouse_move, mouse_entered, mouse_exited).
When running the attached example application as standalone everything is fine, the effect only appears when running the code in a browser. Try hovering the red area first, then open the comboBox and hover the popup.
Example:
package application;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
VBox root = new VBox(5);
Label label = new Label();
root.getChildren().add(label);
ComboBox<String> cb = new ComboBox<String>();
cb.getItems().add("Item 1");
cb.getItems().add("Item 2");
cb.getItems().add("Item 3");
cb.getItems().add("Item 4");
cb.getItems().add("Item 5");
cb.getSelectionModel().select(0);
cb.setTranslateX(50);
root.getChildren().add(cb);
Rectangle rect = new Rectangle(80, 150);
rect.setFill(Paint.valueOf("red"));
rect.setOnMouseEntered(enter -> {
rect.setFill(Paint.valueOf("green"));
});
rect.setOnMouseExited(exit -> {
rect.setFill(Paint.valueOf("red"));
});
rect.setOnMouseMoved((event) -> {
label.setText("Event sceneXY: " + event.getSceneX() + "/" + event.getSceneY());
});
root.getChildren().add(rect);
Scene scene = new Scene(root,200,200);
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}