hentiru
hentiru
FFilament
Created by hentiru on 7/9/2024 in #❓┊help
Numeric TextColumn: sortable() not working properly
Hi, I've faced this issue: sortable() method change randomly the order of the column with numeric field. It doesn't even give an "alphabetical" order on numbers. it was simply random (or in any case not a recognizable order, I couldn't find a pattern...) I found a solution passing sortable as in the code below, but I wonder if it's a known behavior and it's what you guys thought, maybe someone has some insights? return TextColumn::make('priority') ->label('') ->html() ->state('●') ->sortable(query: function(Builder $query, string $direction): Builder { $query->getQuery()->orders = []; $query->orderBy('priority', $direction); return $query; }) ->size(TextColumnSize::Large) ->color(fn (Order $record): string => match (self::determinePriority($record->priority)) { 'high' => 'danger', 'medium' => 'warning', 'low' => 'info', default => 'gray', }); FYI: I tried adding numeric(), removing html(), removing state() showing the numbers to try understanding the pattern and it didn't work...
15 replies
FFilament
Created by hentiru on 7/4/2024 in #❓┊help
TextInput numeric fields are edited by mouse scrolling with ->live() method
Is there a way to disable this behavior? We need the fields to be live for live validation, but the mouse scrolling is really annoying
13 replies