Closed shubhendumadhukar closed 9 months ago
Yes, this is current limitation, which can't be fixed without some internal refactoring. Marked for v4.
Added in v4, which has just been released
Thanks! Tested and it works as expected.
Not sure if I should be asking this here or create a new issue but I had a query regarding the change in the fetch parameter. As per the changelog, it now expects a string. Would it expect the response in specific format? I mean I changed the fetch param to the API endpoint and my dropdown shows a list of undefined
s, I guess I was just wondering how is it parsing the values for the dropdown without my custom fetch override there to parse it for Svelecte.
Edit: Nevermind. Figured it out. Using this in the params list makes it work: valueField="name" labelField="name" valueAsObject
Svelecte tries to get those fields automatically. It probably failed to determinate the labelField
because it seems your response return object with only one property. Am I right?
That's right. Explicitly specifying the field fixed the issue.
I am trying to use Svelecte with
creatable=true
.In my use case:
createTransform
function is as follows:This however does not work, understandably, because
createTransform
probably doesn't support promises. I can make it work by modifying the function as follows:I would however like my
createTransform
function to return theid
value ofrecord
created in DB. Is there a way to makecreateTransform
support promises/async functions?