Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent default keyboard event on the desktop platform #17

Open
DogeVenci opened this issue Jul 14, 2023 · 5 comments
Open

prevent default keyboard event on the desktop platform #17

DogeVenci opened this issue Jul 14, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@DogeVenci
Copy link

Is your feature request related to a problem? Please describe.
I hope to be able to use the tab, up and down arrow keys, and other keys to select options. For TextField, the default key events need to be blocked.

Describe the solution you'd like
prevent default key event like tab, up and down arrows key .

@xsahil03x xsahil03x added the enhancement New feature or request label Jul 14, 2023
@xsahil03x
Copy link
Owner

Hey @DogeVenci, can you explain a bit more on the prevent them on desktop?

@DogeVenci
Copy link
Author

DogeVenci commented Jul 19, 2023

@xsahil03x I am currently using RawKeyboardListener to customize shortcuts.

RawKeyboardListener(
          focusNode: FocusNode(onKey: (node, event) {
            // The process of handling key events.
            return (
                event.logicalKey == LogicalKeyboardKey.arrowUp ||
                    event.logicalKey == LogicalKeyboardKey.arrowDown ||
                    event.logicalKey == LogicalKeyboardKey.tab
            )
                ? KeyEventResult.handled
                : KeyEventResult.ignored;
          }),
         child:  TextField()
         ...
)

My suggestion is to add an onKey method on MultiTriggerAutocomplete to customize the processing of keys event

@xsahil03x
Copy link
Owner

@DogeVenci thanks, I will try to work on this sometime next week.

@gildaswise
Copy link

gildaswise commented Aug 31, 2023

@xsahil03x Hey Sahil, do you still have any plans of adding keyboard navigation? I've been trying to do it by myself to then open a PR but it's way too different of how the default Autocomplete widget works. Great job on the plugin!

@xsahil03x
Copy link
Owner

@gildaswise i do have the plans but I'm a bit busy with the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants