AdeleD / react-paginate

A ReactJS component that creates a pagination
MIT License
2.76k stars 628 forks source link

can I disable the click event for break element #433

Open rinorzek opened 2 years ago

rinorzek commented 2 years ago

I would like to remove the click event on the break element and only keep it for each page number, is there any way around this? Maybe the event object in the onPageChange function to have a property for telling if it's from page change or break?

NeurAlch commented 2 years ago

I would like the same

Zavrazhneva commented 1 year ago

@rinorzek @PabloRosales you can handle this at your side, pass onClick prop and just check isBreak property in onClick event, and in case true just return false from click handler function

You can see how it works here - https://github.com/AdeleD/react-paginate/blob/98db5f7a456919caa0e050164800766f7ca7f2c4/react_components/PaginationBoxView.js#L250