Tabs not working with Shadow Root
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
Tabs do not work inside a shadow root. The cause of this is the following function in SelectorEngine:
getElementFromSelector(element) {
const selector = getSelector(element);
return selector ? SelectorEngine.findOne(selector) : null;
},
instead of calling findOne like that, it should be called using SelectorEngine.findOne(selector, element.getRootNode()) which would solve the problem.
This solution assumes that the tabs and containers lie within the same DOM, but this is a fair assumption.
Reduced test cases
JSfiddle was simpler for me. I just put
https://jsfiddle.net/djae3guf/
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
Firefox
What version of Bootstrap are you using?
5.3.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the SelectorEngine getElementFromSelector function described in the issue, then reproduce the problem with the linked JSFiddle using tabs inside a shadow root. Confirm that tabs and their containers are in the same DOM, and verify that the tabs work in the Firefox scenario described once the issue is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100