Skip to content

Commit

Permalink
Fix: TextColumn size property not applying when badge() is used
Browse files Browse the repository at this point in the history
TextColumn's `size()` property was not taking effect when `badge()` was applied.
This happened because `badge()` and `size()` are handled as different components.

Now, the `size()` property will correctly apply, even when `badge()` is used.
the extras TextColumnSize::ExtraSmall is set as default as it is right now with one size.
  • Loading branch information
moaazmf90 committed Jan 31, 2025
1 parent ac21f7d commit b2d9de7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/support/resources/views/components/badge.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'target' => null,
'tooltip' => null,
'type' => 'button',
'textSize' => null,
])

@php
Expand Down Expand Up @@ -162,7 +163,7 @@
@endif

<span class="grid">
<span class="truncate">
<span @class(["truncate", $textSize])>
{{ $slot }}
</span>
</span>
Expand Down
7 changes: 7 additions & 0 deletions packages/tables/resources/views/columns/text-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ function ($value) {
:color="$color"
:icon="$icon"
:icon-position="$iconPosition"
:text-size="match ($size) {
TextColumnSize::ExtraSmall, 'xs', null => 'text-xs',
TextColumnSize::Small, 'sm' => 'text-sm',
TextColumnSize::Medium, 'base', 'md' => 'text-base',
TextColumnSize::Large, 'lg' => 'text-lg',
default => $size,
},"
>
{{ $formattedState }}
</x-filament::badge>
Expand Down

0 comments on commit b2d9de7

Please sign in to comment.