techouse / select-auto-complete

An auto-completing Laravel Nova search field
MIT License
31 stars 17 forks source link

Select styling duplicated #3

Closed atmediauk closed 5 years ago

atmediauk commented 5 years ago

Hello,

Thanks for the package. I have a question though. When adding, it seems to be inserting multiple styling classes in to the generated select. For example I have the following:

            Select::make('Language', 'language_code')
                ->options(['en' => 'English', 'fr' => 'French', 'es' => 'Spanish'])
                ->displayUsingLabels(),

The select is generated and functions correctly but on the front end I see: image

I have not added any custom select styling.

Thanks

techouse commented 5 years ago

Hi @atmediauk

I am very sorry but I was not able to reproduce this issue with a vanilla Laravel Nova using this plugin and the code you pasted above.

Works for me

atmediauk commented 5 years ago

Hi @techouse

Thanks for looking in to this. I've tried a few clean installs and keep getting the same result (with no console errors).

image

I did notice if I delete this class form-select the field displays correctly.

image

Also I'm not sure if it helps but with my vanilla install I'm using the Laravel installer which installs the latest version (v5.8.16) and then pulling in the latest version of Nova via my composer file (which is v2.0.3). The Select Auto version is v1.0.4 in my lock file.

The only thing I then did was set up the database and add the language_code column. The other thing I did notice was even with the incorrect formatting I can still select an entry and save/ update it and it is stored in the database correctly..

image

However when I look at the index view the language heading appears but the value remains empty.

image

It also does not show the heading or value in show record view.

image

Or pre-populates when going back in to the form to update.

Thanks for your help.

techouse commented 5 years ago

Interesting. Will take a deeper look into it when I have more time to spare. At the moment I'm really swamped. :/

fouedmoussi commented 5 years ago

i've got the same problem You can fix it by deleting the css class specified in the capture

tempsnip3

More specifically the class 'form-select'

techouse commented 5 years ago

I had completely forgotten to set the styling for the .card panel :D

It's been fixed in v1.0.5.

fixed

Thanks again to both of you for reporting.