Skip to content

Commit

Permalink
Fix bugs in components with options.
Browse files Browse the repository at this point in the history
  • Loading branch information
haringsrob committed Feb 23, 2022
1 parent 7476891 commit bab8d46
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/View/Components/Checkboxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(
public function render()
{
return view('twill::partials.form._checkboxes', [
'options' => $this->getOptions(),
'options' => $this->options,
'inModal' => $this->isInModal()
]);
}
Expand Down
4 changes: 3 additions & 1 deletion src/View/Components/FieldWithOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function __construct(
);

$this->options = $options;
$this->options = $this->getOptions();
$this->unpack = $unpack;
$this->columns = $columns;
$this->searchable = $searchable;
Expand All @@ -65,7 +66,8 @@ public function __construct(
$this->requireConfirmation = null;
}

public function isInModal(): bool {
public function isInModal(): bool
{
return $this->fieldsInModal ?? false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/View/Components/MultiSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(
public function render()
{
return view('twill::partials.form._multi_select', [
'options' => $this->getOptions(),
'options' => $this->options,
'inModal' => $this->isInModal()
]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/View/Components/Radios.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
public function render()
{
return view('twill::partials.form._radios', [
'options' => $this->getOptions(),
'options' => $this->options,
'inModal' => $this->isInModal()
]);
}
Expand Down

0 comments on commit bab8d46

Please sign in to comment.