File tree Expand file tree Collapse file tree 3 files changed +16
-28
lines changed Expand file tree Collapse file tree 3 files changed +16
-28
lines changed Original file line number Diff line number Diff line change 110110 <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
111111 1
112112 </button >
113- <div
114- :contenteditable =" !isLoading && !props.isLoading"
113+ <input
114+ type =" text"
115+ v-model =" pageInput"
116+ :style =" { width: `${Math.max(1, pageInput.length+4)}ch` }"
115117 class =" min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightTablePaginationInputText border border-lightTablePaginationInputBorder bg-lightTablePaginationInputBackground dark:border-darkTablePaginationInputBorder dark:text-darkTablePaginationInputText dark:bg-darkTablePaginationInputBackground z-10"
116118 @keydown =" onPageKeydown($event)"
117- @input =" onPageInput($event)"
118119 @blur =" validatePageInput()"
119120 >
120- {{ pageInput }}
121- </div >
121+ </input >
122122
123123 <button
124124 class =" flex items-center py-1 px-3 text-sm font-medium text-lightUnactivePaginationButtonText focus:outline-none bg-lightUnactivePaginationButtonBackground border-l-0 border border-lightUnactivePaginationButtonBorder hover:bg-lightUnactivePaginationButtonHoverBackground hover:text-lightUnactivePaginationButtonHoverText dark:bg-darkUnactivePaginationButtonBackground dark:text-darkUnactivePaginationButtonText dark:border-darkUnactivePaginationButtonBorder dark:hover:text-darkUnactivePaginationButtonHoverText dark:hover:bg-darkUnactivePaginationButtonHoverBackground disabled:opacity-50"
245245 ' sort-change' ,
246246 ' clickTableRow'
247247 ]);
248-
249- function onPageInput(event : any ) {
250- pageInput .value = event .target .innerText ;
251- }
252248
253249 function validatePageInput() {
254250 const newPage = parseInt (pageInput .value ) || 1 ;
Original file line number Diff line number Diff line change 241241 <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
242242 1
243243 </button >
244- <div
245- contenteditable =" true"
246- class =" af-pagination-input min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
244+ <input
245+ type =" text"
246+ v-model =" pageInput"
247+ :style =" { width: `${Math.max(1, pageInput.length+4)}ch` }"
248+ class =" af-pagination-input min-w-10 outline-none inline-block py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
247249 @keydown =" onPageKeydown($event)"
248- @input =" onPageInput($event)"
249250 @blur =" validatePageInput()"
250- >
251- {{ pageInput }}
252- </div >
251+ />
253252
254253 <button
255254 class =" af-pagination-last-page-button flex items-center py-1 px-3 text-sm font-medium text-lightListTablePaginationText focus:outline-none bg-lightListTablePaginationBackgoround border-l-0 border border-lightListTablePaginationBorder hover:bg-lightListTablePaginationBackgoroundHover hover:text-lightListTablePaginationTextHover focus:z-10 focus:ring-4 focus:ring-lightListTablePaginationFocusRing dark:focus:ring-darkListTablePaginationFocusRing dark:bg-darkListTablePaginationBackgoround dark:text-darkListTablePaginationText dark:border-darkListTablePaginationBorder dark:hover:text-white dark:hover:bg-darkListTablePaginationBackgoroundHover disabled:opacity-50"
@@ -599,10 +598,6 @@ async function startCustomAction(actionId: string, row: any) {
599598 }
600599}
601600
602- function onPageInput(event : any ) {
603- pageInput .value = event .target .innerText ;
604- }
605-
606601function validatePageInput() {
607602 const newPage = parseInt (pageInput .value ) || 1 ;
608603 const validPage = Math .max (1 , Math .min (newPage , totalPages .value ));
Original file line number Diff line number Diff line change 262262 <!-- <IconChevronDoubleLeftOutline class="w-4 h-4" /> -->
263263 1
264264 </button >
265- <div
266- contenteditable =" true"
265+ <input
266+ type =" text"
267+ v-model =" pageInput"
268+ :style =" { width: `${Math.max(1, pageInput.length+4)}ch` }"
267269 class =" af-pagination-input min-w-10 outline-none inline-block w-auto py-1.5 px-3 text-sm text-center text-lightListTablePaginationCurrentPageText border border-lightListTablePaginationBorder dark:border-darkListTablePaginationBorder dark:text-darkListTablePaginationCurrentPageText dark:bg-darkListTablePaginationBackgoround z-10"
268270 @keydown =" onPageKeydown($event)"
269- @input =" onPageInput($event)"
270271 @blur =" validatePageInput()"
271272 >
272- {{ pageInput }}
273- </div >
273+ </input >
274274
275275 <button
276276 class =" af-pagination-last-page-button flex items-center py-1 px-3 text-sm font-medium text-lightListTablePaginationText focus:outline-none bg-lightListTablePaginationBackgoround border-l-0 border border-lightListTablePaginationBorder hover:bg-lightListTablePaginationBackgoroundHover hover:text-lightListTablePaginationTextHover focus:z-10 focus:ring-4 focus:ring-lightListTablePaginationFocusRing dark:focus:ring-darkListTablePaginationFocusRing dark:bg-darkListTablePaginationBackgoround dark:text-darkListTablePaginationText dark:border-darkListTablePaginationBorder dark:hover:text-white dark:hover:bg-darkListTablePaginationBackgoroundHover disabled:opacity-50"
@@ -623,9 +623,6 @@ async function startCustomAction(actionId: string, row: any) {
623623 }
624624}
625625
626- function onPageInput(event : any ) {
627- pageInput .value = event .target .innerText ;
628- }
629626
630627function validatePageInput() {
631628 const newPage = parseInt (pageInput .value ) || 1 ;
You can’t perform that action at this time.
0 commit comments