F
Filamentβ€’17mo ago
rich06

prefix() not working for a Select form field?

I'm trying to add a prefix to a select form field as per:- https://filamentphp.com/docs/3.x/forms/fields/select#adding-affix-text-aside-the-field Suffix shows up fine but not the prefix... My code:- Forms\Components\Select::make( 'dollars' ) ->prefix('US$') ->suffix('per day') ->options([ '1' => '50', '2' => '100', '3' => '200', '4' => '500', ]), Output is as per the attached image... any ideas anyone?
No description
17 Replies
awcodes
awcodesβ€’17mo ago
Does prefix show up without suffix? This seems like a bug to me.
rich06
rich06OPβ€’17mo ago
No - taking off the suffix makes no difference the prefix is still missing
Patrick Boivin
Patrick Boivinβ€’17mo ago
Does any other prefix configuration work? Like prefixAction() or prefixIcon()? Same issue here https://discord.com/channels/883083792112300104/1146825766219296799
rich06
rich06OPβ€’17mo ago
No - nothing happens for prefixIcon() nor prefixAction() as well
Lara Zeus
Lara Zeusβ€’17mo ago
the same here all prefix not working for some reasone
@class([
'hidden items-center gap-x-3 ps-3',
'pe-1' => $inlinePrefix && filled($prefix),
'pe-2' => $inlinePrefix && blank($prefix),
'border-e border-gray-200 pe-3 ps-3 dark:border-white/10' => ! $inlinePrefix,
])
@class([
'hidden items-center gap-x-3 ps-3',
'pe-1' => $inlinePrefix && filled($prefix),
'pe-2' => $inlinePrefix && blank($prefix),
'border-e border-gray-200 pe-3 ps-3 dark:border-white/10' => ! $inlinePrefix,
])
the hidden class was flex
awcodes
awcodesβ€’17mo ago
Can you test it on a TextInput and verify that it is not output in the html for selects. It could just be a styling issue with the select.
Lara Zeus
Lara Zeusβ€’17mo ago
I am working with a text input the code from wrapper.blade.php
Lara Zeus
Lara Zeusβ€’17mo ago
GitHub
Comparing v3.0.37...v3.0.38 Β· filamentphp/filament
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - Comparing v3.0.37...v3.0.38 Β· filamentphp/fi...
awcodes
awcodesβ€’17mo ago
Please submit a bug.
Lara Zeus
Lara Zeusβ€’17mo ago
ok or pr? but idk why it's changed
awcodes
awcodesβ€’17mo ago
Pr is good too, please reference the change that broke it in the PR
Lara Zeus
Lara Zeusβ€’17mo ago
ok
awcodes
awcodesβ€’17mo ago
Thank you
Lara Zeus
Lara Zeusβ€’17mo ago
done πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚ it turns out I needed a suffix not prefix I always mix them
rich06
rich06OPβ€’17mo ago
Thanks for doing that!
rich06
rich06OPβ€’17mo ago
looks like it's getting fixed already https://github.com/filamentphp/filament/pull/8199/files
GitHub
Show input icons by sakanjo Β· Pull Request #8199 Β· filamentphp/fila...
Changes have been thoroughly tested to not break existing functionality. New functionality has been documented or existing documentation has been updated to reflect changes. Visual changes are ex...
Lara Zeus
Lara Zeusβ€’17mo ago
no unfortunately, the hidden still there actually I think yes πŸ™‚

Did you find this page helpful?