Skip to content

Commit

Permalink
Impoved value handling of PhoneNumber control
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored May 11, 2023
1 parent 765f6a0 commit e6a65c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Controls/PhoneNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ public function __construct($label = null, ?int $maxLength = null)
}


public function setValue($value = null)
public function setValue($value = null): static
{
$value = Format::phoneNumber($this->value);
return parent::setValue($value);
$this->value = Format::phoneNumber($value);
$this->rawValue = (string) $value;
return $this;
}


public function getValue(): ?string
{
return Sanitize::phoneNumber($this->value);
return Sanitize::phoneNumber(parent::getValue());
}
}

0 comments on commit e6a65c0

Please sign in to comment.