Improve connected overlay positioning #418
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone
When using
appendTo="body"
, dropdown's option list overflows the viewport's width if the element is near to the right side of the screen, even if there is enough space to display the list:You can see it in action here: https://codesandbox.io/s/hardcore-satoshi-xz465?file=/src/components/HelloWorld.vue
I think the problem is at this line of
DomHandler
:primevue/src/components/utils/DomHandler.js
Line 199 in d624e17
The current condition is:
targetOffset.left + targetOuterWidth + elementOuterWidth > viewport.width
which I think is not right, because it is adding both the target and the element width. I think the right condition would be:
targetOffset.left + elementOuterWidth > viewport.width
With this change, the result is:
Do you see any issues with doing that change?
The text was updated successfully, but these errors were encountered: