fix(tile): improve interactive element detection to include aria-role#14239
Conversation
| if (!getInteractiveContent(belowTheFold.current)) { | ||
| setInteractive(false); | ||
| return; | ||
| } else if (!getInteractiveContent(aboveTheFold.current)) { |
There was a problem hiding this comment.
I also found a bug here where the above-the-fold content was not being checked for interactive elements. This was originally introduced with #13365.
When interactive was inversed to be true by default we no longer needed the optimization to bail out of checking the below-the-fold content for interactive elements if the above-the-fold did have interactive elements (line 668).
The new approach ensures that both the above and below content are checked - if either has interactive elements or a role, the 'expandable with interactive' tile is rendered.
✅ Deploy Preview for carbon-components-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
@guidari thanks for catching that! I got so caught up in getting it to detect children with a I added |
|
@guidari @alisonjoseph This one's ready for review 👍 |


Closes #13759
Changelog
New
getRoleContent()for checking if elements within a tree have an aria-role assigned to themChanged
getRoleContent()in tile to render the 'expandable with interactive' tile when children elements have an aria-role assignedTesting / Reviewing