-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] select with icons or dropdown that changes handler #74
Comments
Well, I left the trigger opened for that purpose. You can change the trigger based on the v-model of the dropdown. |
Could you copy paste your code so I can test? What you mean by html in option? Give more detailed stuff so I can help you better! Also are you using the last Buefy version? You didn't use the issue template... |
sorry, i didn't as it wasn't an issue but a feature request. i'm using latest vue version and latest buefy version This is what i'd like to acheive :
but because you do'nt allow html in your b-dropdown-option, i can't do that. Using your label prob will make the code messy, as there's lot of html here + the translation function |
OK, I've understood now what you want. I didn't allow html in slot for security reasons, but I'll figure it out. Edit: But that is not exactly your original issue right? I'll take a look at that afterwards. |
Which security reasons ? Maybe I can help through a PR
Le 26 mai 2017 17:14, "Rafael Beraldo" <notifications@github.com> a écrit :
OK, I've understood now what you want. I didn't allow html in slot for
security reasons, but I'll figure it out.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABXDtaC02fviFQmg-7EDkwHnGBa-MSUkks5r9uxBgaJpZM4NmvBw>
.
|
Actually that doesn't make sense, LMFT. |
Available in next patch: Code is basically the same you provided: <b-dropdown v-model="isPublic">
<button class="button is-primary" type="button" slot="trigger">
<template v-if="isPublic">
<b-icon icon="public"></b-icon>
<span>Public</span>
</template>
<template v-else>
<b-icon icon="people"></b-icon>
<span>Friends</span>
</template>
<b-icon icon="arrow_drop_down"></b-icon>
</button>
<b-dropdown-option :value="true">
<div class="media">
<b-icon class="media-left" icon="public"></b-icon>
<div class="media-content">
<h3>Public</h3>
<small>Everyone can see</small>
</div>
</div>
</b-dropdown-option>
<b-dropdown-option :value="false">
<div class="media">
<b-icon class="media-left" icon="people"></b-icon>
<div class="media-content">
<h3>Friends</h3>
<small>Only friends can see</small>
</div>
</div>
</b-dropdown-option>
</b-dropdown> |
that's nice :) |
* test(lib): update Clockpicker spec - Updates the unit tests (spec) of `Clockpicker` so that they can work with `@vue/test-utils` V2: - Awaits `wrapper.setProps` to make sure the subsequent tests verify the updated state. - Replaces direct data modification with `wrapper.setData` and awaits it to make sure the subsequent tests verify the updated state. - Replaces `wrapper.name()` with `wrapper.vm.$options.name` because `wrapper.name` no longer exists in `@vue/test-utils` V2. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Replaces `propsData` option for `shallowMount` with `props` because `propsData` might be deprecated in the future. - Refreshes the snapshot. Prevents `b-dropdown` from becoming a stub to reproduce a snapshot closer to the legacy one, because default slots in a stub are no longer rendered on `@vue/test-utils` V2. I did not find any problems in the updated snapshot. issue ntohq#1 * test(lib): update ClockpickerFace spec - Updates the unit tests of `ClockpickerFace` so that they can work with `@vue/test-utils` V2: - Awaits `wrapper.setProps` to make sure the subsequent tests verify the updated state. - Replaces direct data modification with `wrapper.setData` and awaits it to make sure the subsequent tests verify the updated state. - Replaces `wrapper.name()` with `wrapper.vm.$options.name` because `wrapper.name` no longer exists in `@vue/test-utils` V2. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Replaces `propsData` option for `shallowMount` with `props` because `propsData` might be deprecated in the future. - Refreshes the snapshot. I did not find any problems in the updated snapshot. issue ntohq#1
i came accross a use case where neither the select component nor the dropdown component solves it.
If you are on facebook, you probably came accross the following image
It gives you the ability to change the privacy of a post but also explains them.
Currently, a dropdown would be the way to go (as there is html inside the options), but here's the problem now, when you make your choice, the dropdown handler / trigger does not change value, therefore the user doesn't have feedback on what he choosed.
In this sens, the behaviour seems more like a select, but because of the html issue (icons and stuff) i can't use the select component.
Api proposal
Could you add on the drop down component a prop replace which would be a boolean, and if set, would replace & show the selected dropdown option instead of the handler / trigger.
The text was updated successfully, but these errors were encountered: