Skip to content

Configure non-propagating keys #16

@ngonzalezpazFC

Description

@ngonzalezpazFC

Feature proposal

When using the editor component, certain key presses, like "Enter," propagate their events, causing unintended behavior. We need a way to trap specific key events within the component to allow for actions like adding a new line without exiting the editor area.
It would be beneficial to have a configuration option to specify which keys should not propagate their events. This would allow us to define keys that only trigger actions within the editor component itself.

We are currently using the following code as a workaround to prevent the Enter key from propagating its event.

editor.getElement().executeJs(
    "this.addEventListener('keydown', (e)=>{if (e.keyCode == 13) e.stopPropagation()});"
);

Describe solution expectations

editor.addStopPropagationOn(Key.ENTER, ...);

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions