microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.11k stars 3.69k forks source link

fix(html): mirror query clearing in URL #33689

Open Skn0tt opened 1 day ago

Skn0tt commented 1 day ago

Closes https://github.com/microsoft/playwright/issues/33681

github-actions[bot] commented 1 day ago

Test results for "tests 1"

37141 passed, 650 skipped :heavy_check_mark::heavy_check_mark::heavy_check_mark:

Merge workflow run.

pavelfeldman commented 1 day ago

Current behavior is by design - look at what you've done to the history (try typing something long and then going back). I don't think this issue is work fixing - we don't want typing (and clearing) to affect the history. They are free to hit Enter to reset the url. Your semantics would not need the form btw, surprised you did non delete it!

Skn0tt commented 1 day ago

Good catch with the history, didn't think about that. Agree that this isn't the most valuable fix to ship, but i'll still have a look if we can update the query on clicking the x without polluting history.

pavelfeldman commented 1 day ago

I think "Submit", "Enter" or "Click" should navigate, while typing in the keyboard should not navigate. If input's clear button was accessible and had a dedicated handler, we could consider it a trigger event. But as it is now, clear button is just a shortcut for typing Backspace a bunch of times, or select all + backspace. That can't navigate.

github-actions[bot] commented 1 day ago

Test results for "tests 1"

1 flaky :warning: [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

37140 passed, 650 skipped :heavy_check_mark::heavy_check_mark::heavy_check_mark:

Merge workflow run.