Move element placement calculations out of container-block? #2167
Unanswered
J4v4Scr1pt
asked this question in
Support
Replies: 1 comment
-
Working sandbox: The other two draggbleButtons is ouside of the main page and you need to zoom out to see them. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
This may be a really stupid question but Im calculating where I should place a component I'm creating. This works as long as I dont place the component inside some div deeper down the page Html hierarchy. Then the placement is calculated based on it's closest containing block. But my component uses position: fixed, this should take it out of the document flow, and no other parent element has a breaking css (like transform, filter, etc.)
Is there any way of telling useSpring to base it placment calculation on the window/viewport rather than its closest parent container?
This is a big component will provide the necessary parts of it.
This image shows the parent containers and where the components calculations is based on:
![image](https://private-user-images.githubusercontent.com/5929055/248002608-af885bf2-9094-4f39-8116-c378c70cb2f1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNjQ3NjksIm5iZiI6MTcyMTI2NDQ2OSwicGF0aCI6Ii81OTI5MDU1LzI0ODAwMjYwOC1hZjg4NWJmMi05MDk0LTRmMzktODExNi1jMzc4YzcwY2IyZjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MThUMDEwMTA5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzJkMzUwNThhMzQ0N2JiODIxOGJiYTFjZTBkNDFjNzMxOWVlMzUwNjM3ZDZiZGVjZjQzOTk2NzAzNGEyMWZlYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7uoi-7bUi2msgXwgqHDr_kTJvM7tjkdrCn8FFNtwbns)
If there is anything other I need to provide or I explained badly please let me know 😊!
Beta Was this translation helpful? Give feedback.
All reactions