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 elements not available when form detached from DOM [regression in 3.6.0] #740

Closed
zbynek opened this issue Feb 29, 2024 · 3 comments
Closed

Comments

@zbynek
Copy link

zbynek commented Feb 29, 2024

The following prints a single input element to console in Chrome:

const form = document.createElement("form");
form.appendChild(document.createElement("input"));
form.remove();
console.log(form.elements);

but in HtmlUnit form.elements becomes empty once form is detached from DOM.

Seems to come from 00ce1ab#diff-ccb37821109ece9c771414e5408dc628f9baf4e80e0ad5c5d16f93e5576ef2a6R609

If the form is detached it would make sense to iterate over its children instead of the whole page.

@rbri
Copy link
Member

rbri commented Feb 29, 2024

Great catch, will have a look. Thanks

@rbri
Copy link
Member

rbri commented Mar 3, 2024

again thanks for the report, this is now fixed in the repo.
Will make a new snapshot build available soon - this will be a 4.0.0-SNAPSHOT because of the major impact the removal of the IE support has to the codebase.
The current plan for the release is end march/start april - hopt that is fine for you

@zbynek
Copy link
Author

zbynek commented Mar 3, 2024

Thanks for the fast fix. The workaround for this is quite simple so there's no rush as far as I am concerned.

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

2 participants