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

Improve handling aria-* props across all components #1929

Open
amje opened this issue Oct 29, 2024 · 5 comments
Open

Improve handling aria-* props across all components #1929

amje opened this issue Oct 29, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@amje
Copy link
Contributor

amje commented Oct 29, 2024

In almost every component we use the same set of two props for labeling: aria-label, aria-labelledby and duplicate code every time. We can now support more props and remove duplication using new interface and helper.

Look at PinInput as a reference

@amje amje added the enhancement New feature or request label Oct 29, 2024
@blasdfaa
Copy link
Contributor

blasdfaa commented Nov 7, 2024

can i take this?

@DanisAvko DanisAvko self-assigned this Nov 11, 2024
@DanisAvko
Copy link

@blasdfaa are you still interested in taking on this task? It's quite specific, so perhaps you'd prefer to choose something else?

@blasdfaa
Copy link
Contributor

@blasdfaa are you still interested in taking on this task? It's quite specific, so perhaps you'd prefer to choose something else?

i dont care :) can I take this then - #1905

@lolmaus
Copy link

lolmaus commented Nov 11, 2024

Moving a discussion from Telegram to this issue per @korvin89's instruction.

Context: I asked for help finding a universal approach for passing arbitrary HTML attributes to any component. I wanted such an approach for my local components but wanted to keep it in sync with Gravity's approach. The specific case was for testing purposes but the discussion grew to the general problem of passing attributes. @korvin89 told me that it was not appropriate to discus the matter in a Telegram group dedicated to testing matters and gave me a link to this issue.


@korvin89, this issue's reference implementation only supports four ARIA attributes:
https://github.com/gravity-ui/uikit/blob/v6.34.0/src/components/utils/filterDOMProps.ts#L6-L9

There are over 50 ARIA attributes that might be arbitrarily required on root elements of any component.

So am I supposed to create a feature request for every individual attribute whenever I need it? And you say I must provide justification for usage of each individual attribute?

And you already denied my suggestion to add support for passing tabindex to any component because there exists a component that overrides tabindex.


Is this the official position of Gravity maintainers? If I have a case where I need to, say, add aria-details to a <Text/>, am I expected to start a separate issue and make a case justifying my need to use this attribute on this particular component? And I may be denied if @korvin89 or another maintainer decides that my case is not common enough (or whatever the acceptance criteria are)?

Same question for non-ARIA attributes such as draggable, tabindex, title, lang, dir, hidden, contenteditable, spellcheck, etc.


TL/DR: I wish I was able to pass any universal HTML attribute to the root element of any component, without soul-crushing bureaucracy that slows down feature development cycle from hours to weeks. Is it such a crazy thing to ask?

@korvin89
Copy link
Contributor

@lolmaus this issue is not relevant to your feature request. I've shown them just for your information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants