Skip to content

Can't type '/' in playground editor #3031

Open
@contificate

Description

@contificate

As reported by someone on the OCaml Discord, the following code results in annoying behaviour in the playground:

window.addEventListener('keydown', function(event) {
if (event.key === "/") {
event.preventDefault();
document.querySelector("input[type='search']").focus()
}
})

On https://ocaml.org/play this results in the user being unable to type / into the code editor, as it pulls focus away (onto the search bar).

Perhaps the handler should be adapted to check whether the editor component is focused?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions