Avoid hiding PaginationArrow component when disabled #2331
-
Hi team! 👋🏻 Here I have a code example:
As you can see on the code itself, as soon as the property is set to true, the component is hidden: https://github.com/twilio-labs/paste/blob/main/packages/paste-core/components/pagination/src/PaginationArrow/PaginationArrowButton.tsx#L33 I would like to ask if it's possible to change this behavior and be able to show the component with a different opacity or color (similar to what happens to buttons when they are disabled). What are your thoughts on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @kcubero27! For this situation, we actually recommend handling this outside of the pagination button. In your onClick function, you can add a debounce or cancel a request if another one happens in rapid succession. The reason being, it would be frustrating for an end user if they want to jump forward 3 pages, you have to press next and then wait each time for the data to load. Also, when the data is loading, you should use the Skeleton Loader component. Please let us know if you have any more questions! |
Beta Was this translation helpful? Give feedback.
Hi @kcubero27!
For this situation, we actually recommend handling this outside of the pagination button. In your onClick function, you can add a debounce or cancel a request if another one happens in rapid succession. The reason being, it would be frustrating for an end user if they want to jump forward 3 pages, you have to press next and then wait each time for the data to load.
Also, when the data is loading, you should use the Skeleton Loader component.
Please let us know if you have any more questions!