Laravel-Backpack / theme-tabler

UI for Backpack v6 that uses Tabler and Bootstrap v5.
MIT License
21 stars 12 forks source link

No aside highlight on sub-pages #151

Closed rdesorme closed 4 months ago

rdesorme commented 8 months ago

Bug report

What I did

I created a CRUD for /brands and went to sub-pages (/brands/create, /brands/1/show, /brands/1/edit).

What I expected to happen

The side menu should highlight the /brands menu item on all of these pages.

What happened

It was highlighted only on the /brands URL, but not on /brands/XXX.

What I've already tried to fix it

I replaced the code in /resources/assets/js/tabler.js :

.filter(el => window.location.href.split("#")[0].split("?")[0] === el.href)

With :

  .filter(el => {
    const href = window.location.href.split("#")[0].split("?")[0];
    return href === el.href || href.startsWith(el.href + '/');
  })

Context to replicate the bug - Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

### PHP VERSION:
PHP 8.2.7 (cli) (built: Jun  8 2023 15:27:12) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

### LARAVEL VERSION:
10.28.0.0

### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.2.1
backpack/crud: 6.2.4
backpack/filemanager: 3.0.4
backpack/generators: v4.0.2
backpack/permissionmanager: 7.1.0
backpack/pro: 2.0.17
backpack/theme-tabler: 1.1.1
karandatwani92 commented 8 months ago

Hey @rdesorme

Can you explain with screenshots so I can understand better? Thanks

rdesorme commented 8 months ago

Hey,

Is this better ?

What I got in Show / Create / Edit What I expect in Show / Create / Edit
image image
pxpm commented 4 months ago

Hey @rdesorme sorry for the delay on this issue.

This should be fixed in 1.2.1 realease earlier today.

Please re-open or comment if you are still experiencing issues