Skip to content

Commit

Permalink
SelectBox: Respect prompt when setting items.
Browse files Browse the repository at this point in the history
Currently SelectBox ignores prompt if it was set before setting items.
This commit ensures that prompt is no longer ignored.
  • Loading branch information
smasty committed Apr 20, 2012
1 parent cc3a717 commit a907c8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Nette/Forms/Controls/SelectBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ final public function areKeysUsed()
*/
public function setItems(array $items, $useKeys = TRUE)
{
$this->items = $items;
$this->allowed = array();
$this->items = $this->prompt === TRUE ? array('' => $this->items['']) + $items : $items;
$this->allowed = $this->prompt === TRUE ? array('' => '') : array();
$this->useKeys = (bool) $useKeys;

foreach ($items as $key => $value) {
Expand Down

0 comments on commit a907c8f

Please sign in to comment.