SpartnerNL / Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel
https://laravel-excel.com
MIT License
12.27k stars 1.92k forks source link

[Bug]: Autosize seems not working on merged cells #4229

Open agiovinazzi opened 3 hours ago

agiovinazzi commented 3 hours ago

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

What version of Laravel Excel are you using?

3.1.55

What version of Laravel are you using?

10.31.0

What version of PHP are you using?

8.3.13

Describe your issue

Autosize seems not working on merged cells, they are smaller than the text.

How can the issue be reproduced?

Merge two cells and put in a sufficient lenght string to full the withd.

What should be the expected behaviour?

The cell should be larger.

agiovinazzi commented 3 hours ago

Hi, using ShouldAutoSize concern, it seems it's not working on merged cells.

class CompensationsSummaryExport implements FromCollection, WithHeadings, WithEvents, ShouldAutoSize

image As you can see, the size on the last 3 columns (not merged) is fine, but in others no. I think the size is taken only from the first row.