I have a problem with scrollbars… I have horizontal scrollbar and also verticals(one or two, second one appears and disappears).
I’ve tried almost everything… removing components from top nav bar, removing left nav bar, removing center injected form - nothing helps.
And it started before I began to tweak theme.
Also I just don’t want to force hide scrollbars as they might be needed in some real occasions.
P.S.: I can share app clone link only with staff members or long time members through PM, can’t share it on open forum.
P.P.S: Theme will be shared with community as soon as I will finish it! ( + custom login/signup, + simple RBAC)
Yeah, I saw that thread, thank you. But it didn’t helped me. Aslo tried to remove components - nope, nothing. Feels like something is wrong with body or main container…
@apearce , you were right! Seems like it’s a bug in Anvil theme? I’ve done like you told me - copied CSS from new project and still have exactly the same problem:
The issue here is that you are using form templates from the built-in Material Design theme within another top-level form (i.e. you add the BuyerForm form to the content panel on your RouterForm form). These templates will not work in that situation - they are designed to be used as top-level forms.
The recommended approach is to have a single top-level form based on one of the Material Design templates, and then add other forms to the content_panel on that form. The nested forms should be created from the Blank Panel template. You can read more about approaches for multi-page navigation here.
If you really want to make your app work with our standard template forms inside a ColumnPanel, which is the structure you have now, then you can set spacing_above and spacing_below to none for the RouterForm and its content_panel, and also set col_spacing to none. That should cause your nested page to fill the screen, removing the scrollbars. But, once again, I wouldn’t recommend this approach!
@daviesian , so hashrouter is not really redirecting to another form but loads it into it’s body?
In my case 3 pages for admin, buyer, seller should be completely different with different menus and top level elements. That’s why I chose this approach.
Also what if I change RouterForm to blank page template?
You can do that with the hash routing, it just takes more work. Your main routing form is the full form, your “pages” use the blank template. In the init function for each of your pages you can use get_open_form () to get the outer form and then can call methods on it to change the contents of the sidebar links, top level elements, etc.
Any page that doesn’t change the sidebar, etc, just inherits whatever the last page set.
Did you change the approach in the end?
If not then another way to make your main router completely blank might be to use an Custom HTML form as the main router, with no components. And in the init method do self.content_panel = self.
This came up in another context and it reminded me of your app.
Found even more unusual way of doing this: Now I have 3 main routers for different roles LoginPage is an entry point and it decides which main router form to open after successful auth. Bet I will have some interesting problems with this approach… but now it is the closest to what I tried to achieve - 3 different apps that use same components and components + server side will decide what to show and what to allow.