File tree 5 files changed +17
-8
lines changed
5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,11 @@ const style = visibleItems > 1
152
152
listen('paginate', event => {
153
153
const target = event.target
154
154
const carousel = target.closest('section').querySelector('[data-id="w-carousel"] ul')
155
+
156
+ if (!carousel) {
157
+ return
158
+ }
159
+
155
160
const progress = target.closest('section').querySelector('.w-carousel-progress')
156
161
const progressValue = (100 / (Number(target.dataset.totalPages) - 1))
157
162
const visibleItems = Number(carousel.dataset.visibleItems) || 0
Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ const hasPagination = data?.length && itemsPerPage
313
313
.closest('section')
314
314
.querySelector('table')
315
315
316
+ if (!table) {
317
+ return
318
+ }
319
+
316
320
const tableRows = Array.from(table.querySelectorAll('tbody tr') as NodeListOf<HTMLTableRowElement>)
317
321
318
322
table.dataset.page = event.page
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ const generatedPages = pages?.length
71
71
<li >
72
72
<Button
73
73
disabled = { disablePrevious || (calculatedCurrentPage === 1 && ! previousLink )}
74
- href = { previousLink }
74
+ href = { ! disablePrevious ? previousLink : undefined }
75
75
theme = { theme }
76
76
data-page = " prev"
77
77
>
@@ -103,7 +103,7 @@ const generatedPages = pages?.length
103
103
<li >
104
104
<Button
105
105
disabled = { disableNext || (calculatedCurrentPage === calculatedTotalPages && ! nextLink )}
106
- href = { nextLink }
106
+ href = { ! disableNext ? nextLink : undefined }
107
107
theme = { theme }
108
108
data-page = " next"
109
109
>
Original file line number Diff line number Diff line change 82
82
{:else }
83
83
<li >
84
84
<Button
85
- disabled ={disablePrevious || (calculatedCurrentPage === 1 && ! previousLink )}
86
- href ={previousLink }
85
+ disabled ={( disablePrevious || (calculatedCurrentPage === 1 && ! previousLink )) ? true : null }
86
+ href ={! disablePrevious ? previousLink : undefined }
87
87
theme ={theme }
88
88
onClick ={! (disablePrevious || (calculatedCurrentPage === 1 && ! previousLink ))
89
89
? () => paginate (' prev' )
124
124
{/if }
125
125
<li >
126
126
<Button
127
- disabled ={disableNext || calculatedCurrentPage === calculatedTotalPages }
128
- href ={nextLink }
127
+ disabled ={( disableNext || calculatedCurrentPage === calculatedTotalPages ) ? true : null }
128
+ href ={! disableNext ? nextLink : undefined }
129
129
theme ={theme }
130
130
onClick ={! disableNext
131
131
? () => paginate (' next' )
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ const Pagination = ({
100
100
< li >
101
101
< Button
102
102
disabled = { disablePrevious || ( calculatedCurrentPage === 1 && ! previousLink ) }
103
- href = { previousLink }
103
+ href = { ! disablePrevious ? previousLink : undefined }
104
104
theme = { theme }
105
105
onClick = { ! ( disablePrevious || ( calculatedCurrentPage === 1 && ! previousLink ) )
106
106
? ( ) => paginate ( 'prev' )
@@ -140,7 +140,7 @@ const Pagination = ({
140
140
< li >
141
141
< Button
142
142
disabled = { disableNext || calculatedCurrentPage === calculatedTotalPages }
143
- href = { nextLink }
143
+ href = { ! disableNext ? nextLink : undefined }
144
144
theme = { theme }
145
145
onClick = { ! disableNext
146
146
? ( ) => paginate ( 'next' )
You can’t perform that action at this time.
0 commit comments