Indicate that links inside labels open in a new window
Most screen readers don't notify when a link is about to open in a new window [1], so we're indicating it, like we were already doing in most places with similar links. We could also add a visual indicator, but since links inside labels already have accessibility issues, giving more attention to these links might make matters worse. [1] https://www.powermapper.com/tests/screen-readers/navigation/a-target-blank/
This commit is contained in:
@@ -9,7 +9,8 @@ class Shared::AgreeWithTermsOfServiceFieldComponent < ApplicationComponent
|
|||||||
|
|
||||||
def label
|
def label
|
||||||
t("form.accept_terms",
|
t("form.accept_terms",
|
||||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
policy: link_to(t("form.policy"), "/privacy", target: "_blank", title: t("shared.target_blank")),
|
||||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank"))
|
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank",
|
||||||
|
title: t("shared.target_blank")))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,4 +18,13 @@ describe Shared::AgreeWithTermsOfServiceFieldComponent do
|
|||||||
|
|
||||||
expect(page).to have_css "a[target=_blank]", count: 2
|
expect(page).to have_css "a[target=_blank]", count: 2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "contains links indicating they open in a new window" do
|
||||||
|
render_inline component
|
||||||
|
|
||||||
|
expect(page).to have_link count: 2
|
||||||
|
expect(page).to have_link "Privacy Policy"
|
||||||
|
expect(page).to have_link "Terms and conditions of use"
|
||||||
|
expect(page).to have_link " (link opens in new window)", count: 2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user