Skip to content

Conversation

julien-nc
Copy link
Contributor

Pretty much all the slots are passed down to Vue-Multiselect except noResult which is hardcoded. This is a naive way to pass it down and keep the default value if not defined. Maybe there's a more elegant way.

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
@julien-nc julien-nc added bug Something isn't working 3. to review Waiting for reviews feature: select Related to the NcSelect* components labels Mar 3, 2022
@julien-nc julien-nc added this to the 5.1.1 milestone Mar 3, 2022
@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 3, 2022

It was done on purpose. Do we really need to make that slot available? What other message do you want to put? :)

@kiranparajuli589
Copy link
Contributor

it would be really helpful if we can change the #noResult message to we're fetching for you if it's still searching, and sorry, no results if no results are found after the search request has been completed.

a static message would not be too helpful in my opinion.

@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 4, 2022

if it's still searching

That should then be fixed and covered by the library itself?

@julien-nc
Copy link
Contributor Author

It was done on purpose

@skjnldsv I feel like it's important to allow those using our MultiSelect to override this and set their own slot content. Alternative messages could be "Nothing found" or whatever text matching the app context (more than "no results").

By making this slot available we also allow conditional content in the slot.

if it's still searching

@kiranparajuli589 Just to make sure we're on the same page: If we can override the #noResult slot, then you can define it like

<template #noResult>
    <span v-if="stillSearching">we're fetching for you</span>
    <span v-else>sorry, no results</span>
</template>

@kiranparajuli589
Copy link
Contributor

if it's still searching

@kiranparajuli589 Just to make sure we're on the same page: If we can override the #noResult slot, then you can define it like

<template #noResult>
    <span v-if="stillSearching">we're fetching for you</span>
    <span v-else>sorry, no results</span>
</template>

@eneiluj absolutely,

@skjnldsv
Copy link
Contributor

skjnldsv commented Mar 4, 2022

I would argue against it, as I would say it's best to be consistent in the feedback messages, thing that usually devs are not great at. :)
But I'm not the only one to decide here, other than this the code looks good, I'm ok to merge 🤷

@julien-nc
Copy link
Contributor Author

@skjnldsv I agree devs are not always putting consistent messages 😁. I still feel there is the need to be able to set the #noResult one in contexts where "No results" makes no sense or is not specific enough.

@juliusknorr
Copy link
Contributor

I think having at least the option to overwrite the message makes sense 👍

@skjnldsv skjnldsv modified the milestones: 5.1.1, 5.2.0 Apr 8, 2022
@juliusknorr juliusknorr modified the milestones: 5.4.0, 6.0.0 Aug 2, 2022
@juliusknorr
Copy link
Contributor

Moving milestone to 6.0, if needed, please consider a backport to stable5 after merge

@PVince81 PVince81 merged commit 254ca82 into master Aug 10, 2022
@PVince81 PVince81 deleted the enh/pass-noresult-slot-in-multiselect branch August 10, 2022 20:06
@PVince81
Copy link
Contributor

/backport to stable5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: select Related to the NcSelect* components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants