laravel-splade icon indicating copy to clipboard operation
laravel-splade copied to clipboard

bug: not being scrolled to anchor links when using x-splade-link

Open ibrunotome opened this issue 10 months ago • 0 comments

  • Laravel Version: v10.19.0
  • PHP Version: 8.2.5
  • Splade JS Version (pnpm): 1.4.16([email protected])([email protected])
  • Splade PHP Version (composer): 1.4.16
  • Dev environment: macOS, Docker ibrunotome/php:8.2-swoole, chrome

Description:

Anchor links using <x-splade-link are not being scrolled to the anchor id

Example:

You're in footer of the hoem page, and there is a link with a anchor:

<li>
  <x-splade-link href="{{ route('ranking.index') }}#minhas-conquistas"
    class="text-sm leading-6 text-gray-300 hover:text-white">
    Minhas Conquistas
  </x-splade-link>
</li>

You'll be redirected to the top of the page instead of the page scrolled to the anchor.

Steps To Reproduce Issue:

  • Create two pages and put a id="anything" into an element on the bottom of the second page.
  • Put a link in the first page with an anchor to the id created above: ex: <x-splade-link href="/page-2#anything">Click Me</x-splade-link>
  • Click in the link

ibrunotome avatar Aug 21 '23 13:08 ibrunotome