mirror of
https://github.com/penpot/penpot.git
synced 2026-11-06 10:00:38 +00:00
🐛 Make the profile page modal links keyboard buttons (#12712)
"Change email" and "Want to remove your account?" were <a> without href that open modals: the keyboard could not reach them. They are now <button type="button"> that keep their text-link look (accent color, underline on hover), so Tab reaches them and Enter or Space opens the modal. The profile visual test gives 0 px of difference, now also with a shot of the hover on "Want to remove your account?". AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
8ab9624f0b
commit
686b47742d
@ -860,6 +860,9 @@ test.describe("Profile page controls", () => {
|
||||
await page.getByText("Change email").hover();
|
||||
await expect(container).toHaveScreenshot(shot);
|
||||
|
||||
await page.getByText("Want to remove your account?").hover();
|
||||
await expect(container).toHaveScreenshot(shot);
|
||||
|
||||
// The "Update" overlay is a button: it shows on keyboard focus too.
|
||||
await page.mouse.move(10, 700);
|
||||
await page.getByRole("button", { name: "Update" }).focus();
|
||||
|
||||
@ -73,8 +73,9 @@
|
||||
|
||||
[:div {:class (stl/css :options)}
|
||||
[:div.change-email
|
||||
[:a {:class (stl/css :link)
|
||||
:on-click on-show-change-email}
|
||||
[:button {:type "button"
|
||||
:class (stl/css :link)
|
||||
:on-click on-show-change-email}
|
||||
(tr "dashboard.change-email")]]]]
|
||||
|
||||
[:> fm/submit-button*
|
||||
@ -84,9 +85,10 @@
|
||||
|
||||
[:div {:class (stl/css :links)}
|
||||
[:div
|
||||
[:a {:class (stl/css :link)
|
||||
:on-click on-show-delete-account
|
||||
:data-testid "remove-acount-btn"}
|
||||
[:button {:type "button"
|
||||
:class (stl/css :link)
|
||||
:on-click on-show-delete-account
|
||||
:data-testid "remove-acount-btn"}
|
||||
(tr "dashboard.remove-account")]]]]))
|
||||
|
||||
;; --- Profile Photo Form
|
||||
|
||||
@ -19,10 +19,20 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// "Change email" and "Want to remove your account?" open modals, so they
|
||||
// are buttons that keep the look of a text link.
|
||||
.link {
|
||||
@include use-typography("body-medium");
|
||||
|
||||
color: var(--color-accent-primary);
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.form-container {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user