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

Update HTML input pattern attribute documentation (fixes #26907) #30867

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

gijsk
Copy link
Contributor

@gijsk gijsk commented Dec 8, 2023

I've tried to apply the feedback from #29842 and reorganized some of the sections to hopefully make them clearer.

Description

This adds language around the specifics of how the pattern attribute's functionality compares with "normal" JS regular expression (notably the addition of the v flag). It also reorganizes the a11y and usability considerations so they read a bit better and aren't spread out across the document.

Motivation

Because I got confused about why [\w-] was not working inside a pattern attribute. It took asking several people before someone was able to point out that the v flag gets applied and that's why the behaviour was different.

Additional details

whatwg/html#7908

Related issues and pull requests

fixes #26907, relates to #29842.

@gijsk gijsk requested a review from a team as a code owner December 8, 2023 10:22
@gijsk gijsk requested review from dipikabh and removed request for a team December 8, 2023 10:22
@github-actions github-actions bot added the Content:HTML Hypertext Markup Language docs label Dec 8, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/HTML/Attributes/pattern
Title: HTML attribute: pattern

(comment last updated: 2024-01-09 09:00:48)

@teoli2003 teoli2003 requested a review from estelle December 20, 2023 11:35
@teoli2003
Copy link
Contributor

Added @estelle as a reviewer, as this PR adds additional accessibility info, and she will be able to review it.

@gijsk
Copy link
Contributor Author

gijsk commented Dec 20, 2023

Added @estelle as a reviewer, as this PR adds additional accessibility info, and she will be able to review it.

It doesn't, actually - it just moves existing content around so it's not under the "example" section and groups usability and accessibility together.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Dec 20, 2023
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@gijsk
Copy link
Contributor Author

gijsk commented Dec 21, 2023

So I'm pretty confused here because this now has conflicts as a result of #31180 which was @estelle's PR to "standardize" the a11y header. It references "guidelines" (where are those? They are not linked - I found https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines but not sure which subdoc the specific guidelines referenced are in). But the header is still in the "examples" section which seems wrong, and I can't tell if the guidelines mean it's "wrong" for me to rename it and include UX-y considerations in the same place. I did so because IMO how and when to show guidance on form validation is not just about accessibility but about usability in general.

I've tried to apply the feedback from mdn#29842 and reorganized some of the sections to hopefully make them clearer.
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

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

Thanks! 🎉

files/en-us/web/html/attributes/pattern/index.md Outdated Show resolved Hide resolved
@estelle estelle merged commit ab06e6d into mdn:main Jan 9, 2024
7 checks passed
dipikabh pushed a commit to dipikabh/content that referenced this pull request Jan 17, 2024
…dn#30867)

* Update HTML input pattern attribute documentation (fixes mdn#26907)

I've tried to apply the feedback from mdn#29842 and reorganized some of the sections to hopefully make them clearer.

* Update files/en-us/web/html/attributes/pattern/index.md

---------

Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

u flag => v flag
3 participants