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

Form preserver iterates through wrong elements #2227

Closed
wannevancamp opened this issue Dec 10, 2021 · 1 comment
Closed

Form preserver iterates through wrong elements #2227

wannevancamp opened this issue Dec 10, 2021 · 1 comment
Labels

Comments

@wannevancamp
Copy link
Contributor

wannevancamp commented Dec 10, 2021

PHP Version

8.1

Shopware Version

6.4.18.0

Expected behaviour

When you add data-form-preserver="true" to a form the value is saved in local storage and filled up with the stored value after a page reload.

Actual behaviour

When you have the other elements in the form besides input fields. The input fields (ex. div) are not taken into account.

How to reproduce

Working example:
<form id="test-form" data-form-preserver="true"> <input name="firstname" type="text"> <input name="lastname" type="text"> </form>

Not working example:
<form id='test-form' data-form-preserver='true'> <input name="firstname" type='text'> <div class='form-row'> <div class='form-group'> <input name="lastname" type='text'> </div> </div> </form>

@tobiasberge
Copy link
Contributor

Hi @wannevancamp, thank you for creating a PR to fix this issue. 👍

You changes were merged to trunk and the PR was marked as "Accepted": 9b0a663

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

No branches or pull requests

2 participants