Add proper labels for site customization texts

We were rendering one label and many textarea fields for that label.
This meant that, when switching to a different language, the label
wasn't correctly associated with the textarea.

So we're now rendering one label for each textarea. We could use
`aria-label` or `aria-labelledby` instead, but using a label offers some
advantages like the fact that clicking on the label makes the textarea
take the focus.
This commit is contained in:
Javi Martín
2024-10-10 22:30:09 +02:00
parent 0f712635a4
commit 331228cb2a
4 changed files with 15 additions and 10 deletions

View File

@@ -496,11 +496,11 @@ describe "Admin edit translatable records", :admin do
scenario "Show selected locale form" do
visit path
expect(page).to have_field "contents_content_#{content.key}values_value_en", with: "Value in English"
expect(page).to have_field content.key, with: "Value in English"
select "Español", from: "Current language"
expect(page).to have_field "contents_content_#{content.key}values_value_es", with: "Value en español"
expect(page).to have_field content.key, with: "Value en español"
end
scenario "Select a locale and add it to the form" do