Rect utility does not work well on mobile devices for Window #3926
Labels
package:utils
resolution:expired
This issue was closed due to lack of feedback.
status:stale
type:bug
This issue reports a buggy (incorrect) behavior.
Is this a bug report or feature request? (choose one)
🐞 Bug report
💻 Version of CKEditor
master
ATM we use
window.innerWidth
(Height
) to determine theRect
of thewindow
. As it turned out this is not the best way because these properties are wild on mobile devices.As a result, UI components that rely on smart positioning (
getOptimalPosition()
helper) and havefitInViewport: true
do not work well on mobiles in some cases. They get positioned beyond the boundaries of the visual viewport. That includes dropdown panels but I suppose other balloons are also affected by this issue.I'm not sure there is a universal solution to the problem (because global properties are acting in a different way depending on the device) but the best solution I found so far is the
VisualViewport
API which is supported in most of the web browsers and should do the trick.FYI (If you checked out the screenshot): We cannot simply use
window.outerWidth|Height
because that would backfire on desktops where these properties include more than just the webpage.cc @mlewand @Reinmar
The text was updated successfully, but these errors were encountered: