@@ -421,16 +421,14 @@ private function initialize(): void
421421$ formId = Crawler::xpathLiteral ($ this ->node ->getAttribute ('id ' ));
422422
423423$ fieldNodes =$ xpath ->query (\sprintf ('( descendant::input[@form=%s] | descendant::button[@form=%1$s] | descendant::textarea[@form=%1$s] | descendant::select[@form=%1$s] | //form[@id=%1$s]//input[not(@form)] | //form[@id=%1$s]//button[not(@form)] | //form[@id=%1$s]//textarea[not(@form)] | //form[@id=%1$s]//select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )] ' ,$ formId ));
424- foreach ($ fieldNodesas $ node ) {
425- $ this ->addField ($ node );
426- }
427424 }else {
428425// do the xpath query with $this->node as the context node, to only find descendant elements
429426// however, descendant elements with form attribute are not part of this form
430427$ fieldNodes =$ xpath ->query ('( descendant::input[not(@form)] | descendant::button[not(@form)] | descendant::textarea[not(@form)] | descendant::select[not(@form)] )[( not(ancestor::template) or ancestor::turbo-stream )] ' ,$ this ->node );
431- foreach ($ fieldNodesas $ node ) {
432- $ this ->addField ($ node );
433- }
428+ }
429+
430+ foreach ($ fieldNodesas $ node ) {
431+ $ this ->addField ($ node );
434432 }
435433
436434if ($ this ->baseHref &&'' !==$ this ->node ->getAttribute ('action ' )) {