Skip to content

Commit

Permalink
Adjust scrollTo
Browse files Browse the repository at this point in the history
  • Loading branch information
JSn1nj4 committed Jul 5, 2024
1 parent a0f1262 commit 3c2d140
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions resources/views/vendor/livewire/tailwind.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$scrollIntoViewJsSnippet = ($scrollTo !== false)
? <<<JS
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView({ behavior: 'smooth' })
JS
: '';
Expand Down Expand Up @@ -66,7 +66,7 @@ class="relative inline-flex items-center px-4 py-2 text-sm font-medium border cu
{!! __('pagination.previous') !!}
</span>
@else
<button type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')"
<button type="button" wire:click.debounce="previousPage('{{ $paginator->getPageName() }}')"
x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled"
dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.before"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium border leading-5 rounded-md focus:outline-none focus:ring transition ease-in-out duration-150 {{ $selectableColors }}">
Expand All @@ -77,7 +77,7 @@ class="relative inline-flex items-center px-4 py-2 text-sm font-medium border le
<span>
@if ($paginator->hasMorePages())
<button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')"
<button type="button" wire:click.debounce="nextPage('{{ $paginator->getPageName() }}')"
x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled"
dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.before"
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium border leading-5 rounded-md focus:outline-none focus:ring transition ease-in-out duration-150 {{ $selectableColors }}">
Expand Down Expand Up @@ -122,7 +122,7 @@ class="relative inline-flex items-center px-2 py-2 text-sm font-medium border c
</span>
</span>
@else
<button type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')"
<button type="button" wire:click.debounce="previousPage('{{ $paginator->getPageName() }}')"
x-on:click="{{ $scrollIntoViewJsSnippet }}"
dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after"
class="relative inline-flex items-center px-2 py-2 text-sm font-medium border rounded-l-md leading-5 focus:z-10 focus:outline-none focus:ring transition ease-in-out duration-150 {{ $selectableColors }}"
Expand Down Expand Up @@ -157,7 +157,7 @@ class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium bo
</span>
@else
<button type="button"
wire:click="gotoPage({{ $page }}, '{{ $paginator->getPageName() }}')"
wire:click.debounce="gotoPage({{ $page }}, '{{ $paginator->getPageName() }}')"
x-on:click="{{ $scrollIntoViewJsSnippet }}"
class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium border leading-5 focus:z-10 focus:outline-none focus:ring transition ease-in-out duration-150 {{ $selectableColors }}"
aria-label="{{ __('Go to page :page', compact('page')) }}">
Expand All @@ -172,7 +172,7 @@ class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium bo
<span>
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')"
<button type="button" wire:click.debounce="nextPage('{{ $paginator->getPageName() }}')"
x-on:click="{{ $scrollIntoViewJsSnippet }}"
dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after"
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium border rounded-r-md leading-5 focus:z-10 focus:outline-none focus:ring transition ease-in-out duration-150 {{ $selectableColors }}"
Expand Down

0 comments on commit 3c2d140

Please sign in to comment.