wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

select with async-data doesn't work on Update #331

Closed MarigonaHoxhaj closed 1 year ago

MarigonaHoxhaj commented 1 year ago

Hi,

I use select component for gender in Create/Update Person, but unfortunately in Update the selected value is not what is fetched from database, but it selects automatically the first option.

image

Looking forward for your feedback.

PH7-Jack commented 1 year ago

@MarigonaHoxhaj Your endpoint have the selected scope? The wireui will send a request to the api with the selected id/ids

MarigonaHoxhaj commented 1 year ago

@PH7-Jack Thank you for your feedback. Now, after your answer, I could find the solution. I recommend to add an example in the documentation related to these kind of cases.

PH7-Jack commented 1 year ago

@MarigonaHoxhaj I'm now fixing a bug when using the async select without the livewire. What kind of solution did you found? Could you share?

MarigonaHoxhaj commented 1 year ago

I check what comes from request, so when request has 'selected', I give this selected id to my filter, and return an array of the results.

PH7-Jack commented 1 year ago

@MarigonaHoxhaj Could you test if this bug is now fixed? If not, let me know

MarigonaHoxhaj commented 1 year ago

Hi @PH7-Jack, Thank you for your fix. I saw your changes, and unfortunately, my problem is completely something else.

PH7-Jack commented 1 year ago

Interesting, could you record a video or we can go a call to understand it and fix @MarigonaHoxhaj

MarigonaHoxhaj commented 1 year ago

Hi @PH7-Jack ,

Sorry, I have found the solution sending the selected in my GetGenders method, I just said you need to mention in the documentation this: "@MarigonaHoxhaj Your endpoint have the selected scope? The wireui will send a request to the api with the selected id/ids"

I created an other issue facing problem with select again, but different from this one. https://github.com/wireui/wireui/issues/339