Skip to content

Commit

Permalink
Merge pull request #1132 from patrickcate/feature/1131/icon-href-attr…
Browse files Browse the repository at this point in the history
…ibute

feat(UsaIcon): switch from deprecated `xlink:href` attribute to `href`
  • Loading branch information
patrickcate authored Jan 12, 2025
2 parents 233633e + 7d4b5b0 commit 575698c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/UsaIcon/UsaIcon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('UsaIcon', () => {

cy.get('svg > use').should(
'have.attr',
'xlink:href',
'href',
'/assets/img/sprite.svg#flag',
)
})
Expand All @@ -44,7 +44,7 @@ describe('UsaIcon', () => {
.and('have.attr', 'focusable', 'true')
.and('have.class', 'usa-icon--size-3')

cy.get('svg > use').should('have.attr', 'xlink:href', '/test.svg#github')
cy.get('svg > use').should('have.attr', 'href', '/test.svg#github')
})

it('custom slot content is used', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/UsaIcon/UsaIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ const iconHref = computed(() => `${svgSpritePath}#${props.name}`)
:focusable="focusable"
>
<slot name="title"></slot>
<use :xlink:href="iconHref"></use>
<use :href="iconHref"></use>
</svg>
</template>

0 comments on commit 575698c

Please sign in to comment.