Skip to content

Commit

Permalink
Fix persist value on select option
Browse files Browse the repository at this point in the history
  • Loading branch information
bittrframework committed May 23, 2019
1 parent 260aa82 commit 6a65bf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,12 @@ public function __toString(): string
$opts = $el['options'];
$tag = $el['tag'];
unset($el['tag'], $el['options']);
$form .= "<{$tag}{$this->makeAttr($el)}>{$this->makeOpt($opts)}</{$tag}>\n";
if (isset($el['name']) && ! $this->val && isset($this->post[$el['name']]))
{
$opts[1] = $this->post[$el['name']];
}

$form .= "<{$tag}{$this->makeAttr($el, false)}>{$this->makeOpt($opts)}</{$tag}>\n";
}
elseif (isset($el['content']))
{
Expand Down

0 comments on commit 6a65bf4

Please sign in to comment.