Skip to content

Commit 30a6bcd

Browse files
committed
simplify hidden check
1 parent 5630551 commit 30a6bcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/forms/src/Components/Concerns/HasState.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ public function dehydrateState(array &$state, bool $isDehydrated = true): void
192192
}
193193
}
194194

195-
foreach ($this->getChildComponentContainers(withHidden: true) as $container) {
196-
if ($container->getParentComponent()?->isHiddenAndNotDehydrated()) {
197-
continue;
198-
}
195+
if ($this->isHiddenAndNotDehydrated()) {
196+
return;
197+
}
199198

199+
foreach ($this->getChildComponentContainers(withHidden: true) as $container) {
200200
$container->dehydrateState($state, $isDehydrated);
201201
}
202202
}

0 commit comments

Comments
 (0)