Skip to content

docs: update textfield.mdx with more clear info on autocomplete and input type="number" #4187

Merged
Barsnes merged 4 commits into
mainfrom
more-explicit-autocomplete-documentation
Nov 6, 2025
Merged

docs: update textfield.mdx with more clear info on autocomplete and input type="number" #4187
Barsnes merged 4 commits into
mainfrom
more-explicit-autocomplete-documentation

Conversation

@Febakke
Copy link
Copy Markdown
Member

@Febakke Febakke commented Oct 29, 2025

Summary

resolves #3373

Checks

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 29, 2025

⚠️ No Changeset found

Latest commit: 7526b36

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 29, 2025

Preview deployments for this pull request:

storybook - 4. Nov 2025 - 15:14

Copy link
Copy Markdown
Member

@Barsnes Barsnes left a comment

Choose a reason for hiding this comment

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

If including the autocomplete attribute on hidden input elements (), its value must be an ordered list of space-separated tokens; the on and off keywords are not allowed.

Comment thread packages/react/src/components/textfield/textfield.mdx Outdated
- Tillat variasjoner i hvordan data skrives inn, så lenge informasjonen er forståelig. For eksempel bør telefonnumre kunne inneholde mellomrom, personnumre punktum, og e-postadresser aksepteres selv om de har et mellomrom til slutt.
- `Autocomplete` er påkrevd etter [1.3.5 formål med inndata (UUTilsynet)](https://www.uutilsynet.no/wcag-standarden/135-identifiser-formal-med-inndata-niva-aa/142) Det hjelper nettlesere og hjelpemidler med å gjenkjenne og fylle ut personopplysninger automatisk.
- Bruk `autocomplete` bare når feltet samsvarer med den forhåndsdefinert listen som er gjengitt på UUtilsynets sider. (For eksempel `given name`, `email` eller `address-line1`)
- Hvis feltet gjelder **en annen person en brukeren**, skal du sette `autocomplete="off"`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdt å nevne at du kan sette autocomplete på overordna <form>?
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form#autocomplete

If an input, select or textarea element has no autocomplete attribute, the browser will use the autocomplete attribute of the element's owning form. The owning form is either the form matching the id specified by the form attribute of the element (if present) or, more commonly, the form the element is nested in.

Note: In order to provide autocompletion, user-agents might require <input>/<select>/<textarea> elements to:
Have a name and/or id attribute
Be descendants of a <form> element
Be owned by a form with a submit button

ref https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete

Febakke and others added 2 commits October 30, 2025 07:31
@Barsnes Barsnes changed the title Docs: Update textfield.mdx with more clear info on autocomplete and input type="number" docs: Update textfield.mdx with more clear info on autocomplete and input type="number" Oct 31, 2025
@Barsnes Barsnes changed the title docs: Update textfield.mdx with more clear info on autocomplete and input type="number" docs: update textfield.mdx with more clear info on autocomplete and input type="number" Oct 31, 2025
Copy link
Copy Markdown
Member

@Barsnes Barsnes left a comment

Choose a reason for hiding this comment

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

Looks great!
We'll move this to www docs once we start that process

@Barsnes Barsnes merged commit fa5f985 into main Nov 6, 2025
11 checks passed
@Barsnes Barsnes deleted the more-explicit-autocomplete-documentation branch November 6, 2025 09:50
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.

Describe 1.3.5 identify input purpose better in our documentation

2 participants