Skip to content

Commit

Permalink
changed visiblity of validate property
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed Jan 31, 2024
1 parent e1d46b4 commit f240b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TextareaPrompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(
public string $placeholder = '',
public string $default = '',
public bool|string $required = false,
public ?Closure $validate = null,
protected ?Closure $validate = null,
public string $hint = ''
) {
$this->trackTypedValue(
Expand Down Expand Up @@ -214,7 +214,7 @@ protected function calculateCursorOffset(): void
{
$this->cursorOffset = 0;

preg_match_all('/\S{'.$this->width.',}/u', $this->value(), $matches, PREG_OFFSET_CAPTURE);
preg_match_all('/\S{' . $this->width . ',}/u', $this->value(), $matches, PREG_OFFSET_CAPTURE);

foreach ($matches[0] as $match) {
if ($this->cursorPosition + $this->cursorOffset >= $match[1] + mb_strwidth($match[0])) {
Expand Down

0 comments on commit f240b38

Please sign in to comment.