Unable to add tabindex in anchor tag using RTE.. | Community
Skip to main content
Level 2
October 17, 2022
Solved

Unable to add tabindex in anchor tag using RTE..

  • October 17, 2022
  • 1 reply
  • 1555 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.
Best answer by ksh_ingole7

Hi @dh54220 

 

Can you please check /apps/cq/xssprotection/config.xml file in your project. I suspect there is a rule for tabindex added. Search with keyword 'tabindex' to look for rule if any. Try altering/removing the rule and check if it works. 

 

Thanks

1 reply

ksh_ingole7
Community Advisor
ksh_ingole7Community AdvisorAccepted solution
Community Advisor
October 17, 2022

Hi @dh54220 

 

Can you please check /apps/cq/xssprotection/config.xml file in your project. I suspect there is a rule for tabindex added. Search with keyword 'tabindex' to look for rule if any. Try altering/removing the rule and check if it works. 

 

Thanks

dh54220Author
Level 2
October 17, 2022

@ksh_ingole7 I found config.xml in this location /libs/cq/xssprotection/config.xml. I uncommented the code for tabindex and tried after that it's not working.