Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 replace perfect scrollbar with ngx-scrollbar #261

Open
Bykiev opened this issue Apr 3, 2024 · 4 comments
Open

v2 replace perfect scrollbar with ngx-scrollbar #261

Bykiev opened this issue Apr 3, 2024 · 4 comments
Assignees

Comments

@Bykiev
Copy link

Bykiev commented Apr 3, 2024

Hi, I know v2 in not supported, but with angular 16 we can't use viewEngine libraries. That's why we need to replace it with ngx-scrollbar. I've only one issue: when the menu is collapsed, it's not possible to expand child menu items. I've tried to fix it with no luck. Can you please help to make it working?

<app-sidebar #appSidebar [fixed]="true" [display]="'lg'" [minimized]="sidebarMinimized" (minimizedChange)="toggleMinimize($event)">
    <ng-scrollbar>
        <app-sidebar-nav [navItems]="menuItems$ | async"></app-sidebar-nav>
    </ng-scrollbar>
    <app-sidebar-minimizer></app-sidebar-minimizer>
</app-sidebar>
@xidedix xidedix self-assigned this Apr 3, 2024
@xidedix
Copy link
Member

xidedix commented Apr 3, 2024

@Bykiev with Angular 16, make sure you've got installed:

  • "ngx-scrollbar": "^13.0.3", (not v14)
  • "@coreui/angular": "~2.16.0",

For sidebar minimized, you'll have to disable the scrollbar. Try sth like:

<app-sidebar #appSidebar [fixed]="true" [display]="'lg'" [minimized]="sidebarMinimized (minimizedChange)="toggleMinimize($event)">
  <ng-scrollbar [disabled]="appSidebar.minimized">
    <app-sidebar-nav [navItems]="menuItems$ | async" />
  </ng-scrollbar>
  <app-sidebar-minimizer />
</app-sidebar>

@Bykiev
Copy link
Author

Bykiev commented Apr 3, 2024

Thank you, unfortunately it doesn't working as expected. With the disabled ng-scrollbar the native scrollbar appears, but still it's not possible to expand children items. With perfect scrollbar it was achieved by setting suppressScrollX: true

@xidedix
Copy link
Member

xidedix commented Apr 3, 2024

@Bykiev you're right. In this case, for minimised sidebar, we'll have to remove ng-scrollbar completely.
What about:

<app-sidebar #appSidebar [fixed]="true" [display]="'lg'" [minimized]="sidebarMinimized (minimizedChange)="toggleMinimize($event)">
  <ng-scrollbar [disabled]="appSidebar.minimized" *ngIf="!appSidebar.minimized; else sidebarNav">
    <ng-container *ngTemplateOutlet="sidebarNav" />
  </ng-scrollbar>
  <ng-template #sidebarNav>
    <app-sidebar-nav [navItems]="navItems" />
  </ng-template>
  <app-sidebar-minimizer />
</app-sidebar>

@Bykiev
Copy link
Author

Bykiev commented Apr 3, 2024

Thank you, looks much better, but after minimization the scrollbar is not working. I'd like to make it working even the sidebar is minimized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants