Skip to content

Commit d650f6e

Browse files
author
Trystan EVENO
committed
fix (DsfrPagination): 🐛 suppression des attributs title redondants avec le texte visible
1 parent 5d19255 commit d650f6e

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/components/DsfrPagination/DsfrPagination.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ describe('DsfrPagination', () => {
88
it('should render a list of links to give quick access to several pages', async () => {
99
// Given
1010
const pages = [
11-
{ label: '1', href: '/#', title: 'Page 1' },
12-
{ label: '2', href: '/#', title: 'Page 2' },
13-
{ label: '3', href: '/#', title: 'Page 3' },
14-
{ label: '4', href: '/#', title: 'Page 4' },
15-
{ label: '5', href: '/#', title: 'Page 5' },
11+
{ label: '1', href: '/#' },
12+
{ label: '2', href: '/#' },
13+
{ label: '3', href: '/#' },
14+
{ label: '4', href: '/#' },
15+
{ label: '5', href: '/#' },
1616
]
1717
const currentPage = 1
1818

1919
// When
20-
const { getByTitle, emitted } = render(Pagination, {
20+
const { getByText, emitted } = render(Pagination, {
2121
global: {
2222
components: {
2323
VIcon,
@@ -29,7 +29,7 @@ describe('DsfrPagination', () => {
2929
},
3030
})
3131

32-
const thirdLink = getByTitle('Page 3')
32+
const thirdLink = getByText('3')
3333
await fireEvent.click(thirdLink)
3434

3535
// Then

src/components/DsfrPagination/DsfrPagination.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
4848
:href="pages[0]?.href"
4949
class="fr-pagination__link fr-pagination__link--first"
5050
:class="{ 'fr-pagination__link--disabled': currentPage === 0 }"
51-
:title="firstPageTitle"
5251
:aria-disabled="currentPage === 0 ? true : undefined"
5352
@click.prevent="currentPage === 0 ? null : tofirstPage()"
5453
>
@@ -60,7 +59,6 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
6059
:href="pages[Math.max(currentPage - 1, 0)]?.href"
6160
class="fr-pagination__link fr-pagination__link--prev fr-pagination__link--lg-label"
6261
:class="{ 'fr-pagination__link--disabled': currentPage === 0 }"
63-
:title="prevPageTitle"
6462
:aria-disabled="currentPage === 0 ? true : undefined"
6563
@click.prevent="currentPage === 0 ? null : toPreviousPage()"
6664
>{{ prevPageTitle }}</a>
@@ -72,7 +70,6 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
7270
<a
7371
:href="page?.href"
7472
class="fr-pagination__link fr-unhidden-lg"
75-
:title="page.title"
7673
:aria-current="isCurrentPage(page) ? 'page' : undefined"
7774
@click.prevent="toPage(pages.indexOf(page))"
7875
>
@@ -86,7 +83,6 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
8683
:href="pages[Math.min(currentPage + 1, pages.length - 1)]?.href"
8784
class="fr-pagination__link fr-pagination__link--next fr-pagination__link--lg-label"
8885
:class="{ 'fr-pagination__link--disabled': currentPage === pages.length - 1 }"
89-
:title="nextPageTitle"
9086
:disabled="currentPage === pages.length - 1 ? true : undefined"
9187
:aria-disabled="currentPage === pages.length - 1 ? true : undefined"
9288
@click.prevent="currentPage === pages.length - 1 ? null : toNextPage()"
@@ -97,7 +93,6 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
9793
:href="pages.at(-1)?.href"
9894
class="fr-pagination__link fr-pagination__link--last"
9995
:class="{ 'fr-pagination__link--disabled': currentPage === pages.length - 1 }"
100-
:title="lastPageTitle"
10196
:disabled="currentPage === pages.length - 1 ? true : undefined"
10297
:aria-disabled="currentPage === pages.length - 1 ? true : undefined"
10398
@click.prevent="currentPage === pages.length - 1 ? null : toLastPage()"
@@ -112,7 +107,7 @@ const isCurrentPage = (page: Page) => props.pages.indexOf(page) === props.curren
112107
<style scoped>
113108
.fr-pagination__link:hover {
114109
background-image: linear-gradient(
115-
deg, rgba(224,224,224,0.5), rgba(224,224,224,0.5));
110+
deg, rgba(224,224,224,0.5), rgba(224,224,224,0.5));
116111
}
117112
.fr-pagination__link--disabled {
118113
color: currentColor;

0 commit comments

Comments
 (0)