How to modify __floater class styles?? #105
-
tried using the floaterProps: styles but it did not work. useEffect(() => {
// Create a MutationObserver instance to watch for changes in the DOM
const observer = new MutationObserver((mutationsList, observer) => {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
const joyRideFloater = document.querySelector('.__floater') as HTMLElement
if (joyRideFloater) {
joyRideFloater.ariaLabel = primaryProps['aria-label']
// joyRideFloater. = primaryProps['data-action']
joyRideFloater.role = primaryProps['role']
joyRideFloater.style.top = '100px'
// once the element is found and the event listener is added
// then it stop observing
observer.disconnect()
}
}
}
})
// start observing the document with the given parameters
observer.observe(document, { childList: true, subtree: true })
// clean up function to remove the event listener when the component unmounts
return () => {
observer.disconnect()
const joyRideFloater = document.querySelector('.__floater')
if (joyRideFloater) {
// @ts-expect-error
// !fix it later (type error)
joyRideFloater.addEventListener('click', primaryProps.onClick)
}
}
}, []) this too did not worked |
Beta Was this translation helpful? Give feedback.
Answered by
gilbarbara
Feb 17, 2024
Replies: 1 comment
-
Hey @Parthvsquare |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gilbarbara
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @Parthvsquare
Popper.js calculates the positioning, and it will override the static styles.
The element responsible for positioning is the parent of the
.__floater
one.You might be able to override the
transform
property of the parent instead, but I never tried.