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

[BITV] 9.3.3.2/3.4 - Sharing menu: The "Note to recipient" input field does not have a visual label, it only has a placeholder element. (2) #37088

Closed
3 tasks done
AndyScherzinger opened this issue Mar 7, 2023 · 9 comments
Assignees
Labels
4. to release Ready to be released and/or waiting for tests to finish accessibility

Comments

@jancborchardt
Copy link
Member

jancborchardt commented Aug 30, 2023

@Pytal @JuliaKirschenheuter for the sharing flow redesign we have a pattern of checkboxes with label which open an input or textarea below: #39472 – same pattern as in the above screenshot essentially.

Question there is: Can we use the same label that is used for the input field also for the input / textarea below? They belong together, and otherwise duplication might be needed. Or which approach would you recommend here?

@jancborchardt
Copy link
Member

Also cc @Fenn-CS @artonge on the previous comment as they work on that pull request currently.

@Pytal
Copy link
Member

Pytal commented Aug 30, 2023

@Pytal @JuliaKirschenheuter for the sharing flow redesign we have a pattern of checkboxes with label which open an input or textarea below: #39472 – same pattern as in the above screenshot essentially.

Question there is: Can we use the same label that is used for the input field also for the input / textarea below? They belong together, and otherwise duplication might be needed. Or which approach would you recommend here?

Good point, since NcCheckboxRadioSwitch contains a label and an input already and a label can only be for a single id (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attributes) then I believe we could use aria-labelledby here

span
  input id="foo"
  label for="foo" id="bar"
span
textarea aria-labelledby="bar"

Does that work @michaelnissenbaum ?

@ShGKme
Copy link
Contributor

ShGKme commented Sep 4, 2023

Good point, since NcCheckboxRadioSwitch contains a label and an input already and a label can only be for a single id (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label#attributes) then I believe we could use aria-labelledby here

I checked it with NVDA screen reader, and it works fine.

A link to a PoC demo:
https://codepen.io/ShGKme/pen/QWzKxRL

@AndyScherzinger
Copy link
Member Author

@michaelnissenbaum would the solution proposed by @ShGKme in #37088 (comment) be fine by you?

@michaelnissenbaum
Copy link

I think you may not have understood the issue here. The problem is that the <textarea> element does not have a visual label. We're not discussing programmatically linked labels in this context.

@Pytal
Copy link
Member

Pytal commented Sep 8, 2023

The idea of using

span
  input id="foo"
  label for="foo" id="bar"
span
textarea aria-labelledby="bar"

for
image
was to have "Note to recipient" label both the checkbox and the textarea

Yes, this is not a separate visual label conventionally used for textarea but in this context it makes sense to use the already existing text to label the textarea as well to avoid duplication

The programmatic link then is to ensure that in this case screen readers will read out the label when focused

Does that make sense @michaelnissenbaum ?

@Pytal
Copy link
Member

Pytal commented Sep 14, 2023

What do you think @michaelnissenbaum about the suggestion ?

@michaelnissenbaum
Copy link

I disagree with the proposed solution. The current implementation is confusing and may not be understood by some users. The <textarea> element needs a separate label.

@Pytal Pytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Oct 6, 2023
@Pytal Pytal closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish accessibility
Projects
None yet
Development

No branches or pull requests

5 participants