Problem/Motivation
We can't create a custom pagination structure because we must follow the convention:
<ul class="js-pager__items">
<li><a class="pagination__item" href="#" aria-current="page" aria-label="Current Page, Page 1">1</a></li>
<li><a class="pagination__item" href="#" aria-label="Page 2">2</a></li>
<li><a class="pagination__item" href="#" aria-label="Page 3">3</a></li>
<li><a class="pagination__item" href="#" aria-label="Page 4">4</a></li>
<li><a class="pagination__item" href="#" aria-label="Page 5">5</a></li>
</ul>
It means that we must have `ul.js-pager__items > li > a` toajax pagination work correctly.
But in li tag, we can use a lot of different tags like:
<a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <video>, <wbr>
and Text.
When we build pagination using a different structure than what I showed above it will not work.
Steps to reproduce
Create ajax pagination like on example below:
<ul class="js-pager__items">
<li><div><a class="pagination__item" href="#" aria-current="page" aria-label="Current Page, Page 1">1</a></div></li>
<li><div><a class="pagination__item" href="#" aria-label="Page 2">2</a></div></li>
<li><div><a class="pagination__item" href="#" aria-label="Page 3">3</a></div></li>
<li><div><a class="pagination__item" href="#" aria-label="Page 4">4</a></div></li>
<li><div><a class="pagination__item" href="#" aria-label="Page 5">5</a></div></li>
</ul>
Pagination is not working as expected (ajax is not applied to that pagination).
Proposed resolution
We should add one more selector `.js-pager__items a` that will give us a possibility to create custom pagination without any issues.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet