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

ElementInternals reportValidity() should focus the validation anchor element #10600

Open
zcorpan opened this issue Sep 5, 2024 · 0 comments
Open

Comments

@zcorpan
Copy link
Member

zcorpan commented Sep 5, 2024

What is the issue with the HTML Standard?

See web-platform-tests/wpt#47934 and demo https://software.hixie.ch/utilities/js/live-dom-viewer/saved/13058

The spec for report validity steps says

If report is true, then report the problems with the constraints of this element to the user. When reporting the problem with the constraints to the user, the user agent may run the focusing steps for element, and may change the scrolling position of the document, or perform some other action that brings element to the user's attention. User agents may report more than one constraint violation, if element suffers from multiple problems at once.

element is the custom element, not the validation anchor element set up in https://html.spec.whatwg.org/#dom-elementinternals-setvalidity

It seems browsers focus the validation anchor element instead of element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants