Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page.keyboard.press("Tab") input "Tab" as text #57

Closed
jeiea opened this issue Apr 9, 2024 · 8 comments · Fixed by #129
Closed

page.keyboard.press("Tab") input "Tab" as text #57

jeiea opened this issue Apr 9, 2024 · 8 comments · Fixed by #129
Labels
bug Something isn't working

Comments

@jeiea
Copy link
Contributor

jeiea commented Apr 9, 2024

Steps to reproduce

import { launch } from "https://deno.land/x/[email protected]/mod.ts";
const browser = await launch();
const page = await browser.newPage('https://google.com');
await page.keyboard.type("Tab");

Expected behavior

Press tab key

Actual behavior

Type "Tab"

@lino-levan
Copy link
Owner

Does await page.keyboard.type("\t"); work?

@jeiea
Copy link
Contributor Author

jeiea commented Apr 9, 2024

import { launch } from "https://deno.land/x/[email protected]/mod.ts";
const browser = await launch();
const page = await browser.newPage(
  "https://news.ycombinator.com/login?goto=news",
);
await page.keyboard.type("a\tb\tc\td");

image

@lino-levan
Copy link
Owner

Hm, appears to work?

@jeiea
Copy link
Contributor Author

jeiea commented Apr 9, 2024

Expected behavior in that case is focus movement, so

a
b
c
d

@lino-levan
Copy link
Owner

Is the expected behavior consistent with the behavior of other tools (e.g. puppeteer, playwright, etc)? Perhaps we could have something like page.accessibility.tabNext()?

@jeiea
Copy link
Contributor Author

jeiea commented Apr 9, 2024

I don't know about puppeteer or playwright behavior, so I simply used "Tab" because it was type hinted.

However, I have noticed other constants present there. If you decide to add tabNext, you should first remove that hint.

@lino-levan
Copy link
Owner

Ah okay, right. This is a bug with my implementation. Will fix, thank you. Not sure what it would actually do, but it should just work.

@lino-levan lino-levan added the bug Something isn't working label Jun 8, 2024
@jaydenseric
Copy link

See also #124 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants