From 3ab4f9c5de207bd856aaf9d7db65e6b815a15119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 22 May 2023 09:35:44 +0200 Subject: [PATCH] simplify selector and use trigger --- src/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form.php b/src/Form.php index 2a72e4cbf9..58528140f4 100644 --- a/src/Form.php +++ b/src/Form.php @@ -135,7 +135,7 @@ protected function init(): void parent::init(); $this->formElement = View::addTo($this, ['element' => 'form', 'shortName' => 'form'], ['FormElementOnly']); - $this->on('submit', new JsExpression('if (event.target === this) { []; }', [$this->js(false, null, $this->formElement)->form('submit')])); + $this->on('submit', new JsExpression('if (event.target === this) { []; }', [$this->formElement->js()->trigger('submit')])); $this->initLayout();