I'm working on a simple dropdown implementation. Using JavaScript, an aria-expanded attribute is toggled between false and true, and its specific content's visibility is toggled then.
I'm used to NVDA announcing a change of aria-expanded very reliably when the focus is on the specific link or button.
Demo: https://codepen.io/accessibility-developer-guide/pen/pKoJbK
But I noticed that when this link or button has some content with ::before { content: '...' }, the change is not announced anymore.
Demo: https://codepen.io/accessibility-developer-guide/pen/VdwvwW
I wanted to display a + or - sign in front of the dropdown toggler to indicate its status visually. But this doesn't seem to work with content: '...'.
Is this expected behaviour? Or a bug?
I'm working on a simple dropdown implementation. Using JavaScript, an
aria-expandedattribute is toggled betweenfalseandtrue, and its specific content's visibility is toggled then.I'm used to NVDA announcing a change of
aria-expandedvery reliably when the focus is on the specific link or button.Demo: https://codepen.io/accessibility-developer-guide/pen/pKoJbK
But I noticed that when this link or button has some content with
::before { content: '...' }, the change is not announced anymore.Demo: https://codepen.io/accessibility-developer-guide/pen/VdwvwW
I wanted to display a
+or-sign in front of the dropdown toggler to indicate its status visually. But this doesn't seem to work withcontent: '...'.Is this expected behaviour? Or a bug?