Skip to content

Commit 066a21b

Browse files
committed
SelectBox: refactoring
1 parent 13be885 commit 066a21b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Forms/Controls/SelectBox.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,11 @@ public function getControl(): Nette\Utils\Html
9595
$items[is_array($value) ? $this->translate($key) : $key] = $this->translate($value);
9696
}
9797

98-
return Nette\Forms\Helpers::createSelectBox(
99-
$items,
100-
[
101-
'disabled:' => is_array($this->disabled) ? $this->disabled : null,
102-
] + $this->optionAttributes,
103-
$this->value,
104-
)->addAttributes(parent::getControl()->attrs);
98+
$attrs = $this->optionAttributes;
99+
$attrs['disabled:'] = is_array($this->disabled) ? $this->disabled : null;
100+
101+
return Nette\Forms\Helpers::createSelectBox($items, $attrs, $this->value)
102+
->addAttributes(parent::getControl()->attrs);
105103
}
106104

107105

0 commit comments

Comments
 (0)