Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.18k stars 897 forks source link

colspan issue in `ListOperation` #4951

Open EGYWEB-Mohamed opened 1 year ago

EGYWEB-Mohamed commented 1 year ago

Bug report

What I did

responsive table

What I expected to happen

image

What happened

image

and I noticed from inspect element there's colspan added to the first row

image

What I've already tried to fix it

N/A

Is it a bug in the latest version of Backpack?

Yes

Backpack, Laravel, PHP, DB version

PHP VERSION:

PHP 8.1.7 (cli) (built: Jun 16 2022 12:46:39) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.1.7, Copyright (c) Zend Technologies with the ionCube PHP Loader v12.0.5, Copyright (c) 2002-2022, by ionCube Ltd.

LARAVEL VERSION:

v9.52.4@9239128cfb4d22afefb64060dfecf53e82987267

BACKPACK PACKAGE VERSIONS:

backpack/crud: 5.5.1 backpack/devtools: 1.3.2 backpack/editable-columns: 2.1.1 backpack/filemanager: 2.0.0 backpack/generators: 3.3.14 backpack/permissionmanager: 6.0.16 backpack/pro: 1.6.0

tabacitu commented 1 year ago

Hmm... I'm not sure I understand @EGYWEB-Mohamed . Can you please rephrase? Everywhere I have responsiveTable enabled... it works... there's no such visual bug like you showed in your screenshot. How did you do that? What did you do different - that's the part I don't understand.

Is it happening anywhere in our demo https://demo.backpackforlaravel.com/admin/article?

Cheers!

EGYWEB-Mohamed commented 1 year ago

@tabacitu after too many hours of investigation I found it causes when there are too many columns and responsiveTable => true in list.php and what is causing is showEntryCount => true when it is true the problem is fixed by itself image

and when it changes to false, this weird problem appears image

karandatwani92 commented 1 year ago

Hi @jorgetwgroup Following the above instructions I'm unable to reproduce this error. Neither I found anything in src related to colspan Please have a look and let me know what you find then we fix it.

adriannuta commented 1 year ago

I can confirm this bug as well: it reproduces with showEntryCount=false and on small resolutions. It does not reproduce if responsive table is disabled. If if you redrawn the result (e.g. using no. of entries per page dropdown), it renders fine.

mint-ws commented 1 year ago

I see this issue has been added to the Todo list but for what it's worth, I'm experiencing the exact same issue. First row gets a colspan on a responsive table.

showEntryCount = false:

image

showEntryCount = true:

image

I've also noticed the page number in the pagination links at the bottom of the table also does not show.

showEntryCount=false:

image

showEntryCount=true:

image

Huge thank you to @EGYWEB-Mohamed for figuring out the fix.

EGYWEB-Mohamed commented 1 year ago

@mint-ws You're welcome! I'm glad to hear that It's always great when people come together to help each other out.

pxpm commented 1 year ago

Hey guys.

Thanks for the report and solution @EGYWEB-Mohamed and everyone who participated here.

I hope that we fixed this somehow 🤷 , I was totally unable to reproduce this in our demo:

image

image

I am preemptively closing this, but if you guys still experience the issue, please provide me the clear steps on how I can reproduce it, ideally in our demo, or in a clean install.

Cheers

zeknoss commented 8 months ago

Hello, I can also confirm that disabling the row count on the list view makes the first row of table render the first column with wrong colspan value.

@pxpm I believe you can reproduce this issue using the tabler theme.

K-Mazur commented 6 months ago

Hi,

I can confirm that I've also encountered this bug. Not sure if that helps or not, but it appears that when we set showEntryCount to false, then in the ListOperation trait, the $totalEntryCount and $filteredEntryCount are set up differently, and once $filteredEntryCount is 0, the problem occurs. https://github.com/Laravel-Backpack/CRUD/blob/1fe921d1b1dbabafcad587e49582e13c453cf9ae/src/app/Http/Controllers/Operations/ListOperation.php#L107-L114

pxpm commented 3 months ago

I've tried really hard to reproduce this again, but unfortunatelly I am still not able.

I've tried enable/disable showEntryCount, I've tried forcing the filteredEntryCount to be 0 as suggested by @K-Mazur, I've tried enabled and disabled responsive table, nothing yielded those results.

image image image

image image image

One thing I noticed from your screenshots is that the search bar on the top right has rounded borders, while we use for some time square borders. Is it possible that you guys have the list.blade.php and or datatables_logic.blade.php overwritten in your projects and are not loading the backpack view ?

I would really love to be able to reproduce this, if anyone can setup a reproduction repo I can use, I will glady fix this, until then I am totally in the dark here 😞

Going to keep this open for a while hoping someone can provide me a way to reproduce this.

Cheers

mint-ws commented 3 months ago

Hi there, since I stopped using backpack some time ago I can't provide a sample. I didn't override list.blade.php and or datatables_logic.blade.php but I do see from your screenshots that the page numbers in the pagination links (bottom right) still don't show when showEntryCount=false. If that's not intentional maybe therein lies a clue. Sorry I can't be more helpful.

pxpm commented 3 months ago

Hi there, since I stopped using backpack some time ago I can't provide a sample. I didn't override list.blade.php and or datatables_logic.blade.php but I do see from your screenshots that the page numbers in the pagination links (bottom right) still don't show when showEntryCount=false. If that's not intentional maybe therein lies a clue. Sorry I can't be more helpful.

Thanks @mint-ws, appreciate your feedback. Not showing the page numbers when showEntryCount is false is a feature. To display the page numbers we would need to do the count to know how many pages of information there are so it would defeat the purpose of not doing the count on the first place.

Thanks a lot for your input, I will wait to see if someone else have a better insight 🙏

Cheers

zeknoss commented 3 months ago

Hi there, since I stopped using backpack some time ago I can't provide a sample. I didn't override list.blade.php and or datatables_logic.blade.php but I do see from your screenshots that the page numbers in the pagination links (bottom right) still don't show when showEntryCount=false. If that's not intentional maybe therein lies a clue. Sorry I can't be more helpful.

Thanks @mint-ws, appreciate your feedback. Not showing the page numbers when showEntryCount is false is a feature. To display the page numbers we would need to do the count to know how many pages of information there are so it would defeat the purpose of not doing the count on the first place.

Thanks a lot for your input, I will wait to see if someone else have a better insight 🙏

Cheers

Hey @pxpm, which theme are you using in your tests?

pxpm commented 3 months ago

@zeknoss screenshots are from tabler theme, but I also tested on coreui-v2.

zeknoss commented 3 months ago

I'll try to come up with a reproduction guide for you, asap