Skip to content

Can't type slash in the search field #2483

Closed
@jonasfj

Description

@jonasfj

Because / is a shortcut the jumps focus to the search field.

It's probably best to test if document.activeElement is a input or textarea tag before stealing focus and calling e.preventDefault().

$(document).keypress(function(event) {
if (event.which == 47 /* / */) {
event.preventDefault();
$('#' + name).focus();
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work ontype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions