daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

Page numbers don't scroll past first 10 in some conditions #518

Open jontsnz opened 7 years ago

jontsnz commented 7 years ago

The dropdown containing the page numbers usually fetches another 10 entries once you scroll down to the last item in the dropdown. Under Chrome 55.0.2883.75 (64-bit) on the external screen of a Macbook Pro Retina it does not fetch the next 10 when you scroll to the 10th item. However, if you click ">" from the 10th to go to the 11th, then it will fetch the next 10, and continues to fetch 10 from that point onwards.

md-datatable page numbers

Debugging reveals that the content.prop('scrollTop') is returning a decimal rather than an integer. This appears to be caused by a recent change to Chrome to support hi-res devices.

The solution is to round the property when fetching it: Math.round(content.prop('scrollTop'))