Skip to content

Commit

Permalink
fix: Link href
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Nov 16, 2024
1 parent fa9b4cb commit 31152ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/UI/src/Components/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public function __construct(
parent::__construct();

$this->setLabel($label);

$this->customAttributes([
'href' => $this->href,
]);
}

public function button(): self
Expand Down Expand Up @@ -67,6 +63,13 @@ public function getView(): string
. ($this->isButton ? 'button' : 'native');
}

protected function prepareBeforeRender(): void
{
$this->customAttributes([
'href' => value($this->href, $this),
]);
}

/**
* @return array<string, mixed>
*/
Expand Down

0 comments on commit 31152ba

Please sign in to comment.