Skip to content

fix: fix '(' mapping and add more key mappings#45

Open
Romulad wants to merge 2 commits intocrutchcorn:mainfrom
Romulad:fix/complete-key-map
Open

fix: fix '(' mapping and add more key mappings#45
Romulad wants to merge 2 commits intocrutchcorn:mainfrom
Romulad:fix/complete-key-map

Conversation

@Romulad
Copy link
Copy Markdown
Contributor

@Romulad Romulad commented Mar 28, 2026

What:

Extend the default key map to support additional characters such as / and :.

Why:

Currently, some common characters are not handled correctly by the default key map.

For example:

userEvent.keyboard('https://google.com');

Produces:

httpsUnknownUnknownUnknowngoogle.com

This happens because characters like / and : are not mapped, leading to Unknown outputs.

How:

  • Added missing key mappings for:
    • / (\x2f)
    • : (\x3a)
    • additional characters
  • Fixed an incorrect mapping for (:
    • previously mapped to \x29
    • corrected to \x28

Checklist:

  • Tests (N\A)
  • TypeScript definitions updated (N\A)
  • Ready to be merged

@Romulad Romulad changed the title fix: fix '(' mapping and add more keyboard mapping fix: fix '(' mapping and add more key mappings Mar 28, 2026
@crutchcorn crutchcorn marked this pull request as ready for review March 28, 2026 12:51
@crutchcorn
Copy link
Copy Markdown
Owner

Whoops! I marked this as a "ready for review" PR despite you making it a draft. This LGTM - is it ready to go from your perspective?

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cli-testing-library@45

commit: e1c3f88

@Romulad
Copy link
Copy Markdown
Contributor Author

Romulad commented Mar 28, 2026

Yes, it’s ready from my perspective. I’m also thinking about a potential improvement to make the key mapping more scalable. I’ll open an issue about that.

@crutchcorn
Copy link
Copy Markdown
Owner

Love it! Look forward to seeing it :)

@Romulad
Copy link
Copy Markdown
Contributor Author

Romulad commented Mar 28, 2026

Great!

@Romulad
Copy link
Copy Markdown
Contributor Author

Romulad commented Mar 28, 2026

Here my suggestion: #46 (comment)
Please, let me know what you think about it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants