Still pretty new to LWC and trying to understand the communication between parent/child and how to create logic to it.
So, the goal here is to have the child component with position: fixed when you start scrolling the page until it reaches a certain point, where it is set to position: relative
I've set a class to the child component and I'm calling it within the parent, but I'm seeing a "SecureElement: [object HTMLElement]{ key: {"namespace":"c"} }"
This is due to the Locker service and here's my doubt...the logic should be done in a window scroll event, how to select the child component by class and change it's position?
Here's the HTML:
<div class="col">
<c-detail-gallery
class="product-gallery">
</c-detail-gallery>
</div>
The JS to select it:
stickyProductGallery() {
setTimeout(() => {
let productGallery = this.template.querySelector('.product-gallery');
console.log('product gallery element' + productGallery);
}, 3000);
}