Fix form with mulitple buttons doesn't recognize whether it's been submitted
This commit is contained in:
parent
192a21b668
commit
fdadba59ca
|
@ -18,6 +18,16 @@ class MigrationForm extends Form
|
|||
'name' => 'migration-form'
|
||||
];
|
||||
|
||||
public function hasBeenSubmitted(): bool
|
||||
{
|
||||
if (! $this->hasBeenSent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$pressedButton = $this->getPressedSubmitElement();
|
||||
return $pressedButton && strpos($pressedButton->getName(), 'migrate-') !== false;
|
||||
}
|
||||
|
||||
protected function assemble(): void
|
||||
{
|
||||
$this->addHtml($this->createUidElement());
|
||||
|
|
Loading…
Reference in New Issue