nebular icon indicating copy to clipboard operation
nebular copied to clipboard

Where to place nb-sidebar-header within nb-layout in v4

Open pdomala opened this issue 5 years ago • 8 comments

Issue type

I'm submitting a ... (check one with "x")

  • [X] bug report
  • [ ] feature request

Issue description

Current behavior: Below code displays the sidebar within the scroll container. It leaves empty space equal to the height of the main header

Expected behavior: But as per the documentation, it should be displayed on top of the scroll container.

Steps to reproduce: Run the app with above layout code.

Related code:

<nb-layout>
  <nb-layout-header subheader>
    <app-header class="w-100"></app-header>
  </nb-layout-header>

  <nb-sidebar>
    <nb-sidebar-header>
      <span>My Sidebar Header</span>
    </nb-sidebar-header>
    <app-sidebar></app-sidebar>
  </nb-sidebar>

  <nb-layout-column>
    <router-outlet></router-outlet>
  </nb-layout-column>
</nb-layout>

Other information:

npm, node, OS, Browser

<!--
Node, npm: `node --version` and `npm --version`
OS: Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
Browser: Chrome/Safari/Firefox/etc?
-->

Angular, Nebular

"dependencies": {
    "@angular/animations": "~8.0.0",
    "@angular/cdk": "^8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "@nebular/bootstrap": "^4.1.0",
    "@nebular/eva-icons": "4.1.0",
    "@nebular/theme": "^4.1.0",
    "rxjs": "~6.5.2",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  }

pdomala avatar Jun 25 '19 02:06 pdomala

HI, I found a solutions for me, is out nb-sidebar from nb-loyout and then apply a css class: html:

  <nb-sidebar-header>
    <nb-user size="large" name="Jonh Doe" title="Engineer" picture="https://via.placeholder.com/50/4479e7/ffffff?Text=IMG"
    onlyPicture>
  </nb-user>
  </nb-sidebar-header>
<!--my menu with scroll bar-->
  <app-menu></app-menu>

  <nb-sidebar-footer>
    close
  </nb-sidebar-footer>

</nb-sidebar>


<nb-layout>
  <nb-layout-column class="column-container">

    <router-outlet></router-outlet>

  </nb-layout-column>

</nb-layout>

and the css:

nb-user {
  position: absolute;
  left: 0;
}

nb-sidebar-header {
  min-height: 5rem;
}

.column-container {
  padding-left: 5rem !important;
}

Sorry if my code is dirty

json-alzate avatar Aug 13 '19 02:08 json-alzate

I can add that this behavior can't be overriden even in the global scss file. It's a bit annoying.

brneor avatar Dec 16 '19 14:12 brneor

9 months later and this component is still broken

gvonhagel avatar Feb 26 '20 17:02 gvonhagel

Add [containerFixed]="false" to

<nb-sidebar [containerFixed]="false">

fredericojesus avatar Mar 12 '20 16:03 fredericojesus

Add [containerFixed]="false" to

<nb-sidebar [containerFixed]="false">

Doing so makes the sidebar content scroll with the page

savy-91 avatar Nov 26 '20 10:11 savy-91

Here is what worked for me (I am not using a header and everything is in the sidebar): Add this in styles.scss: .main-container { top: 0px !important; }

savy-91 avatar Nov 26 '20 10:11 savy-91

Hello, is there any progress on this?

malachibazar avatar Jun 01 '21 23:06 malachibazar

Hi, any news on that ?

shifubrams avatar Feb 03 '22 11:02 shifubrams