Hi, I use latest creator 3.8.1 with web target (web-mobile, web-desktop) and some modern Andorid devices has troubles with listen “orientation-change” event. Some devices never handle that event, some devices catch strange width/height values. I tried to logging this issue from root: found place inside cocos core in package engine/pal/screen-adapter/web/screen-adapter.ts and log inside handler for window.addEventListener(‘orientationchange’ …
Looks like “windowSize” object has incorrect values here, but I don’t know why.
sorry for late answer, I found fix, unfortunately I cant provide certain devices and browsers versions, but this case I mentioned above occurs on Samsung and Xiaomi device in theirs native browsers.
Here is my fix, it works fine for all devices:
The class below is just a wrapper to send OrientationChanged event in proper time, also my own event dispatcher used. The main idea is check orientation using new windowSize width/height after 1sec after “window-resize” event fired