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

Combobox: 🐛 implement Readonly + disabled #3180

Merged
merged 12 commits into from
Sep 30, 2024
Merged

Conversation

JulianNymark
Copy link
Contributor

@JulianNymark JulianNymark commented Sep 26, 2024

Description

Both readonly and disabled were not working for Combobox. This PR aims to implement both of those in one fell swoop (mostly since they are similar-ish features).

Closes: https://github.com/navikt/team-aksel/issues/645
Closes: #3049

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

@JulianNymark JulianNymark self-assigned this Sep 26, 2024
Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: 7b64a6f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@navikt/ds-react Patch
@navikt/ds-css Patch
@navikt/aksel-stylelint Patch
@navikt/aksel Patch
@navikt/ds-tokens Patch
@navikt/ds-tailwind Patch
@navikt/aksel-icons Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 26, 2024

Storybook demo

Endringer til review: 1

6699cad12 | 90 komponenter | 141 stories

@JulianNymark
Copy link
Contributor Author

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding aria-readonly to the input field (Looks like role="combobox" overrides til semantics of the readOnly prop)

Copy link
Contributor Author

@JulianNymark JulianNymark Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried setting the readOnly native html attribute (which is preferred to aria-readonly, but even with and without the role="combobox" attribute, it seems to not be presented to screenreaders as a read-only input? 🤔

I would like something like this:

<input type="text" role="combobox" readOnly />

Need to do a bit more experimentation to find a combination of role, type and readonly / aria-readonly that works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe support for readonly is just a bit lackluster currently? 😞, at least we now set it for future support, and readonly is read up from the title on the readonlyIcon.

@JulianNymark JulianNymark changed the title 🐛 [Combobox] implement Readonly + disabled Combobox: 🐛 implement Readonly + disabled Sep 27, 2024
Copy link
Contributor

@it-vegard it-vegard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@JulianNymark JulianNymark merged commit d278060 into main Sep 30, 2024
5 checks passed
@JulianNymark JulianNymark deleted the combobox-readonly branch September 30, 2024 09:24
@github-actions github-actions bot mentioned this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Combobox sin readOnly-prop virker ikke
3 participants