Skip to content

When screenReaderMode=true, keypress triggers unwanted default browser behaviors #4269

@JasonXJ

Description

@JasonXJ

Details

  • Browser and browser version: Chrome 109
  • OS version: ChromeOS and others
  • xterm.js version: ToT

Steps to reproduce

  1. set screenReaderMode=true
  2. Press keys such as ctrl+p / ctrl+f. Observe that the printing / find dialog pops up, steals the focus, and makes the user's life miserable 😢

This is caused by the code here, which cancels the key event only if screenReaderMode is off. I wonder if this is to allow the screen reader to handle some key bindings. I am not sure about other OSes, but on ChromeOS, screen reader bindings (e.g. Search+up) works fine even if the key event is canceled. I think we should just always cancel the key event. If there is indeed a need to pass through the key event, the user of xterm.js can set a custom key handler with attachCustomKeyEventHandler(). What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions