Skip to content

Make UP and DOWN arrows select another index in MFXFilterComboBox #397

@FelipeAumannRS

Description

@FelipeAumannRS

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();
                        }
                    });
                }
            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions