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

RequestDataValueProcessor inserts hidden fields at the beginning of the form, not the end #249

Open
adrianpillinger opened this issue Feb 3, 2021 · 0 comments

Comments

@adrianpillinger
Copy link

Thymeleaf 3.0.12
Spring boot 2.3.6.RELEASE
Spring 5

Thymeleaf documentation states under section 11.1 that hidden fields will be injected at the end of the form.

th:action calls RequestDataValueProcessor.processAction(...) before rendering the form’s action attribute, and additionally it detects when this attribute is being applied on a

tag —which should be the only place, anyway—, and in such case calls RequestDataValueProcessor.getExtraHiddenFields(...) and adds the returned hidden fields just before the closing tag.

However the behaviour is that the hidden fields are inserted after the opening form tag instead of before the end tag.

This caused us a migration issue from Thymeleaf 2 where it broke some CSS using a :before sudo class on the form content. We fixed this via CSS, but fixing the inconsistent behaviour in the thymeleaf spring code to be the same as version 2 will make a smoother upgrade path for others.

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

No branches or pull requests

1 participant