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

fix: scroll error into view with nested key names #904

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

staffe
Copy link
Contributor

@staffe staffe commented Jan 4, 2023

Hello! I ran into an error when using nested fields with the option scrollErrorIntoView: true

The addon code evaluates to document.querySelector('[name=fields.nestedfield]') and throws the following exception:
Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'name=fields.nestedfield' is not a valid selector.

The fix is to replace . with \\. in the query selector, i.e document.querySelector('[name=fields\\.nestedfield]')

Thank you!

@derrabauke
Copy link
Contributor

Hey @staffe !

Thanks for pointing out this issue and for the provided fix. We will have a look at it as soon as possible.

Cheers

@derrabauke derrabauke self-assigned this Feb 23, 2023
@derrabauke derrabauke self-requested a review February 23, 2023 11:21
@derrabauke derrabauke removed their assignment Feb 23, 2023
Copy link
Contributor

@derrabauke derrabauke left a comment

Choose a reason for hiding this comment

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

👍

@derrabauke
Copy link
Contributor

@staffe Could you please rebase onto upstream/main so the pipeline can run again and we can proceed with merging your PR.

@staffe
Copy link
Contributor Author

staffe commented Feb 23, 2023

@staffe Could you please rebase onto upstream/main so the pipeline can run again and we can proceed with merging your PR.

Thanks, I've synced my fork

@derrabauke
Copy link
Contributor

@staffe Could you please rebase onto upstream/main so the pipeline can run again and we can proceed with merging your PR.

Thanks, I've synced my fork

Glad for the quick response. It seems like you have to run yarn lint:fix und push again. ;)

@staffe
Copy link
Contributor Author

staffe commented Feb 23, 2023

I see, sorry about that. It should be sorted now

@derrabauke
Copy link
Contributor

I see, sorry about that. It should be sorted now

No need to be sorry. Thanks for your contribution.

@derrabauke derrabauke merged commit 5c192a5 into adfinis:main Feb 23, 2023
adfinisbot pushed a commit that referenced this pull request Feb 23, 2023
# [6.2.0](v6.1.2...v6.2.0) (2023-02-23)

### Bug Fixes

* scroll error into view with nested key names ([#904](#904)) ([5c192a5](5c192a5))

### Features

* **a11y:** add aria invalid and describedby attributes on validation ([6e16a51](6e16a51)), closes [#48](#48)
@adfinisbot
Copy link
Member

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants