filament icon indicating copy to clipboard operation
filament copied to clipboard

Adding ->url() to a column when using grid, adds extra blank column

Open andy-UKC opened this issue 1 year ago • 1 comments

Package

filament/filament

Package Version

v3.0.0

Laravel Version

v11

Livewire Version

v3

PHP Version

8.3

Problem description

If you have a Grid, and inside that there is a column with a url('somehting'), an extra column is added before the url column. It is blank, and causes the remaining columns to be bunched. In testing, it is also dependent on there being an edit route in getPages(). It is the same issue as mentioned here: https://github.com/filamentphp/filament/discussions/9361

Screenshot 2024-11-12 at 10 47 17

Expected behavior

no additional columns to be added when using ->url() Screenshot 2024-11-12 at 10 47 45

Steps to reproduce

in the repo, either comment out the ->url() line, or the edit route in getPages()

Reproduction repository (issue will be closed if this is not valid)

https://github.com/andy-UKC/filament-url-grid-bug

Relevant log output

No response

andy-UKC avatar Nov 12 '24 10:11 andy-UKC

Same as https://github.com/filamentphp/filament/issues/9878. I commented the problem there

CyberLine avatar Apr 24 '25 08:04 CyberLine

Filament wraps the entire record in a <a> when the "Record URL" feature is being used. The browser breaks when you then put another link inside the record, since it doesn't allow nested <a> tags.

To fix this, you can use $table->recordUrl(null) to remove the wrapping <a>.

danharrin avatar Jun 22 '25 16:06 danharrin