Skip to content

Commit

Permalink
call whenAttached() immediately when form is attached [Fix #45]
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed Apr 5, 2020
1 parent 8e0aa35 commit e3a337b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Multiplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ protected function attached(IComponent $obj): void
$this->setCurrentGroup($obj->getCurrentGroup());
}
if ($obj instanceof \Nette\Application\UI\Form) {
$obj->onAnchor[] = function (): void {
if ($obj->isAnchored()) {
$this->whenAttached();
};
} else {
$obj->onAnchor[] = function (): void {
$this->whenAttached();
};
}
}
$obj->onRender[] = function (): void {
$this->whenAttached();
Expand Down

0 comments on commit e3a337b

Please sign in to comment.