Unable to add tabindex in anchor tag using RTE | Community
Skip to main content
RashidJorvee
Level 4
February 22, 2022

Unable to add tabindex in anchor tag using RTE

  • February 22, 2022
  • 2 replies
  • 1993 views

Hi All,

I came to a scenario where I need to create an anchor tag without href attribute using RTE component. I am able to create anchor tag using HTML option in RTE, but the thing is that anchor tag is getting skipped by tab index and never focused. Then I tried adding attribute tabindex=0 so that that anchor tag get focus, but that tabindex=0 attribute is not getting persist in html. Any idea why it is not allowed and how I can fix this in RTE? Thank you in advance!

 

Example

I am adding below syntax in HTML of RTE  

<a tabindex=0 class="new-class">click here</a>

 

In DOM the HTML element I am seeing this

<a class="new-class">click here</a>

 

Expected rendition

    <a tabindex=0 class="new-class">click here</a>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Shubham_borole
Community Advisor
Community Advisor
February 22, 2022

Can you please check antisamy rules at /libs/cq/xssprotection/config.xml?
Search for 'tabindex'

Also check in case if you have overlay of this file under /apps.

 

RashidJorvee
Level 4
February 22, 2022

@shubham_borole I uncommented the code for tabindex and tried after that but no luck.

Shubham_borole
Community Advisor
Community Advisor
February 22, 2022

Can you also try restarting the instance? if its worth it

Kiran_Vedantam
Community Advisor
Community Advisor
February 22, 2022

Hi @rashidjorvee 

 

Cant you just add a "#" as link for the anchor tag?

 

Thanks,

Kiran Vedantam.