Skip to content

Commit

Permalink
make all Fomantic-UI .form() calls form's owning div
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 21, 2023
1 parent 3f8b9bb commit 5b181e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function initLayout(): void
}

// allow to submit by pressing an enter key when child control is focused
$jsSubmit = $this->js(false, null, $this->formElement)->form('submit');
$jsSubmit = $this->js()->form('submit');
$this->on('submit', new JsExpression('if (event.target === this) { []; }', [$jsSubmit]));

// Add save button in layout
Expand Down Expand Up @@ -549,8 +549,7 @@ public function ajaxSubmit(): void
{
$this->js(true)->form(array_merge(['inline' => true, 'on' => 'blur'], $this->formConfig));

$this->js(true, null, $this->formElement)
->api(array_merge(['url' => $this->cb->getJsUrl(), 'method' => 'POST', 'serializeForm' => true], $this->apiConfig));
$this->js(true)->api(array_merge(['url' => $this->cb->getJsUrl(), 'method' => 'POST', 'serializeForm' => true], $this->apiConfig));

// [name] in selector is to suppress https://github.com/fomantic/Fomantic-UI/commit/facbca003cf0da465af7d44af41462e736d3eb8b
// console errors from Multiline/vue fields
Expand Down
2 changes: 1 addition & 1 deletion src/Table/Column/FilterPopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function init(): void
$model->clearData();

return new JsBlock([
$this->form->js(false, null, $this->form->formElement)->form('reset'),
$this->form->js()->form('reset'),
new JsReload($this->reload),
(new Jquery($this->colTrigger))->trigger('click'),
]);
Expand Down
2 changes: 1 addition & 1 deletion src/UserAction/StepExecutorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ protected function jsSetSubmitButton(View $view, Form $form, string $step): void
? $this->execActionButton
: $this->nextStepButton; // submit on next

$view->js(true, $button->js()->on('click', new JsFunction([], [$form->js(false, null, $form->formElement)->form('submit')])));
$view->js(true, $button->js()->on('click', new JsFunction([], [$form->js()->form('submit')])));
}

/**
Expand Down

0 comments on commit 5b181e7

Please sign in to comment.