Skip to content

feat: add customizing to KeyCodeService #3052

@minimalisticMe

Description

@minimalisticMe

🙋 Feature Request

I would like to override specific default browser behavior in KeyCodeService when using OnKeyDownAsync. I know I can prevent all default browser behavior at once with

<FluentKeyCodeProvider PreventDefault="true" />

With this I can prevent page jumping when pressing [SPACE], debugging with [F12] or navigating forth/back with [ALT] + [<-] / [->]. However I would prefer to have some of these default behaviors while preventing to have others.

For example I have custom use for the [SPACE] key, so I do not want to have default prowser behavior.
On the other hand I would like to stilll be able to navigate with [ALT] + [<-] / [->] or debug with [F12].

It feels wrong to prevent all default behavior just to reimplement some behavior that I want to keep.

🤔 Expected Behavior

Configure specific keys that I want to use custom logic instead of default browser behavior.

😯 Current Behavior

Either all default behavior is prevented or none, no distinction can be made.

💁 Possible Solution

I think this could be managed with a optional parameter, that configures which keys will override default behavior. Per default none of the keys implement event.preventDefault(); and only explicitely configured keys implement event.preventDefault();.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:not-actionableThere is no action to be taken in response to this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions