Skip to content

Commit

Permalink
SelectBox: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 1, 2024
1 parent 13be885 commit 066a21b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Forms/Controls/SelectBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,11 @@ public function getControl(): Nette\Utils\Html
$items[is_array($value) ? $this->translate($key) : $key] = $this->translate($value);
}

return Nette\Forms\Helpers::createSelectBox(
$items,
[
'disabled:' => is_array($this->disabled) ? $this->disabled : null,
] + $this->optionAttributes,
$this->value,
)->addAttributes(parent::getControl()->attrs);
$attrs = $this->optionAttributes;
$attrs['disabled:'] = is_array($this->disabled) ? $this->disabled : null;

return Nette\Forms\Helpers::createSelectBox($items, $attrs, $this->value)
->addAttributes(parent::getControl()->attrs);
}


Expand Down

0 comments on commit 066a21b

Please sign in to comment.