Skip to content

Commit

Permalink
simplify selector and use trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 22, 2023
1 parent 84470c5 commit 3ab4f9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 3ab4f9c

Please sign in to comment.