I am using an Aura-based experience builder site. On the site I have a lwc that I have…
- User
I am using an Aura-based experience builder site. On the site I have a lwc that I have enabled Light DOM for. I am doing this because I want to target a child button element from a sibling Aura component that is using an external Js library called IntroJS. IntroJs needs to target an element in order to attatch tour steps.
After enabling the Light DOM, I am able to enter the chrome console and use document.Query selector and I get a result however when I use document.querySelector from the Aura component I get null. Why is that?
Assistant
There are a few reasons why document.querySelector might be returning null when used from an Aura component with Light DOM enabled:
-
Incompatibility between Aura and LWC: It's possible that the IntroJS library is not compatible with LWC components, and may not be able to properly target child elements within an LWC component. To resolve this issue, you could try using an alternative library that is designed to work with both Aura and LWC components, or try using a different approach to attach tour steps to your button element.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.