Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort button cut off on first column in table #296

Open
benjibee opened this issue Oct 3, 2024 · 0 comments
Open

Sort button cut off on first column in table #296

benjibee opened this issue Oct 3, 2024 · 0 comments

Comments

@benjibee
Copy link

benjibee commented Oct 3, 2024

In the following snippet of a table if I add sortable to the first column the button that is shown is cut off on the left side.

<flux:table>
    <flux:columns>
        <flux:column sortable>Customer</flux:column>
        <flux:column>Date</flux:column>
        <flux:column>Status</flux:column>
        <flux:column>Amount</flux:column>
    </flux:columns>

    <flux:rows>
        <flux:row>
            <flux:cell>Lindsey Aminoff</flux:cell>
            <flux:cell>Jul 29, 10:45 AM</flux:cell>
            <flux:cell>
                <flux:badge color="green" size="sm" inset="top bottom">Paid</flux:badge>
            </flux:cell>
            <flux:cell variant="strong">$49.00</flux:cell>
        </flux:row>
    </flux:rows>
</flux:table>

Image

Possible Fix

Only applying the padding resets if the column isn't sortable fixes it, though it may not match with other overall design ideas you're going for.

// stubs/resources/views/flux/column.blade.php:9

$classes = Flux::classes()
    ->add('py-3 px-3')
    ->add($sortable ? '' : 'first:pl-0 last:pr-0')
    ->add('text-left text-sm font-medium text-zinc-800 dark:text-white')
    ->add($align === 'right' ? 'group/right-align' : '')
    ;

Image

@benjibee benjibee changed the title Sortable button is cutoff on first column in table Sort button cutoff on first column in table Oct 3, 2024
@benjibee benjibee changed the title Sort button cutoff on first column in table Sort button cut off on first column in table Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants