Search code examples
sapui5scrollbarsemantic-uisap-fiori

disable scroolbar in sap.f.semantic.SemanticPage


I want to disable the scroll bar in the semantic page (master) and add a scroll to the list in semantic:content only, so my goal is to prevent scroll in the header of the semantic page.

enableScrolling="false" doesn't exist in sap.f.semantic.semantic page


Solution

  • checking the API there is no parameter for disabling thescrollbar. I would try something like this:

    • limit content: if <content> doesn't exceed the full height, no scrollbar will be visible (try sap.ui.table.Table with visibleRowCount)
    • scroll: add scroll container (ScrollContainer) to the content

    Example for scroll:

    <semantic:SemanticPage
        class="noScroll"
        id="mySemanticPage"
        headerPinnable="false"
        toggleHeaderOnTitleClick="false"
        preserveHeaderStateOnScroll="true"
        showFooter="{/showFooter}">
    
        <!-- Content -->
        <semantic:content>
            <ScrollContainer
                    class="myContainer"
                    height="100%"
                    width="100%"
                    horizontal="true"
                    vertical="true"
                    focusable="true">
    

    css:

    .noScroll .sapFDynamicPageContent {
        padding: 0;
        height: 100%;
    }
    
    .noScroll .sapFDynamicPageContent > div {
        padding: 0;
        height: 100%;
    }