[Silk UI Mobile] LandScape problem

[Silk UI Mobile] LandScape problem

  
Forge Component
(13)
Published on 4 Aug (2 weeks ago) by OutSystems R&D
13 votes
Published on 4 Aug (2 weeks ago) by OutSystems R&D

Hello,

I tried to rotate my screen on tablet and is not working, i can't select the menu.

When i inspect my device i notice the body class tablet and landscape on tablet are not appearing, and this problem causes the isTablet() function to return empty because the javascript is searching the tablet class in the body.


Can you check this? 


Thank you.

Hello Tiago,

Can you please tell me what's the resolution of your tablet's screen?

Hi,


Let me explain the problem a little better, my application works fine in portrait and landscape in phones, and also works good in tablets in portrait mode, if I load it in the tablet in landscape mode, or if I rotate the tablet from portrait to landscape, several things stop working, for example, the menu stops working, swipe actions on the list also stop working.

After some debugging I noticed that the class on the Body element of the screens is empty, in portrait it shows like this class="phone portrait android", when in portrait it shows like this class=""

I have tested in 2 different android tablets and the behaviour is the same.


Answering Rita dias, the 2 tablets resolutions are 2560x1440 and 1280x800

Hi Tiago Alves,

Use the following code in OnReady Action inside Layout: 

var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;

var body = document.querySelector('body');

if(windowWidth > 1024) {
   
    body.classList.add('tablet');
   
    if(windowWidth > windowHeight){
        body.classList.add('landscape');    
    } else {
        body.classList.add('portrait');
    }
   
}


My Regards