MaterialFX
MaterialFX copied to clipboard
Make UP and DOWN arrows select another index in MFXFilterComboBox
Tried using the code blow to move selected index in MFXFilterComboBox popUp, didn't work. As far as I can tell, there's no way of retrieving popUp to change its behavior.
Platform.runLater(() -> {
BoundTextField textFieldNode = (BoundTextField) comboBox.lookup(".text-field");
if (textFieldNode != null) {
textFieldNode.setOnKeyPressed( ev -> {
if (ev.getCode() == KeyCode.DOWN || ev.getCode() == KeyCode.KP_DOWN) {
comboBox.selectNext();
ev.consume();
} else if (ev.getCode() == KeyCode.UP || ev.getCode() == KeyCode.KP_UP) {
comboBox.selectPrevious();
ev.consume();
}
});
}
});
Hello, unfortunately to change the behavior I think you'll have to tinker with the combo's skin, where the popup is created.
I'll mark this as an enhancement for the new version