0

I'm using an <ion-footer> tag on Ionic4 to sits content at the bottom of the page: https://ionicframework.com/docs/api/footer

Ionic automatically add a role="contentinfo" attribute on the <ion-footer> tag.

The contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privacy statements (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Contentinfo_role)

In my case, I'm not using <ion-footer> to display information repeated, so to be more accessible, I'd like to delete this attribute, or replace it with role="presentation".

Is it possible to change the value of this attribute on <ion-footer> tag?

Thank you for your help.

  • If you aren't using `ion-footer` as a footer on every page then you are using the wrong component. I wouldn't attempt to change it, instead make your own component (as `ion-footer` exposes itself as a `
    ` element)
    – GrahamTheDev Nov 30 '19 at 11:02
  • I'm using on every page, but only a few part of display informations repeated. I would like to have [content]
    [content]
    . But, I will make my own component. Thank you for your help.
    – Sébastien Delorme Dec 01 '19 at 20:36

1 Answers1

0

<ion-footer> is a root component that sits at the bottom of the page.

That is directly from the documentation.

The <ion-footer> exposes itself as a <footer> element in the HTML so any other use case other than an article or document footer is semantically incorrect and just swapping out the role will not help.

You should instead create a custom component, or find an alternative component if you have another use case.

You could obviously give the component a custom class and style it however you want but make sure the component is semantically correct.

GrahamTheDev
  • 22,724
  • 2
  • 32
  • 64
  • I'm using on every page, but only a few part of display informations repeated. I would like to have [content]
    [content]
    . But, I will make my own component (it is the better way to do that).
    – Sébastien Delorme Dec 01 '19 at 20:38
  • I think the component still stands up under your use case. Generally footers are the same but if you are exposing different links etc. as part of the footer based on the page I don't see a problem with that. I found this stack overflow question that may offer some guidance, most of the answers are good https://stackoverflow.com/questions/11191746/should-role-contentinfo-be-always-added-on-footer-element – GrahamTheDev Dec 01 '19 at 21:17