When on the last page the next link is grayed out and on the first page the previous link is grayed out. There is no way to hide the links in this case through the interface and there is no class provided for first/last to hide through css.
This can especially be an issue if you are using token replacement added in https://www.drupal.org/node/2870793. If you were to use [node:title] in the link, on the last page the next link would show the title of the current page, but grayed out, which is confusing.
I was able to solve this for my case in the entity-pager.html.twig by checking the type of link {% if link['#type'] == 'link' %}. But this would also hide the page count if a user was using this.
Comments
Comment #2
chriswingerComment #3
replicaobscuraI've added a 'Show disabled links' option to the display settings, which is enabled by default. Unchecking this should hide the disabled prev/next links. Let me know if you run into any issues with this implementation.
Committing shortly.
Comment #5
replicaobscuraThanks again for the report!
Fix is in dev, and will be in a new release soon.
Comment #7
JmOkay commentedhttps://www.drupal.org/node/2870646#comment-12204369 ...this solution will simplify your code plus cover this scenario + unforeseen future requests in this area.
All the best - JmOkay