Skip to content

added option hide selection button #345

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/vue-tel-input.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ describe('Props', () => {

expect(wrapper.find('.vti__dropdown-item .vti__flag').exists()).toBeFalsy();
});
it('.hideSelection hide the select button from the list', () => {
const wrapper = shallowMount(VueTelInput, {
propsData: {
dropdownOptions: {
hideSelection: true,
},
},
});
expect(wrapper.find('.vti__selection').exists()).toBeFalsy();
});
});
describe(':ignoredCountries', () => {
it('hides countries from the list', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/vue-tel-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@keydown.esc="reset"
@keydown.tab="reset"
>
<span class="vti__selection">
<span class="vti__selection" v-if="!dropdownOptions.hideSelection">
<span
v-if="dropdownOptions.showFlags"
:class="['vti__flag', activeCountryCode.toLowerCase()]"
Expand Down
7 changes: 7 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export const allProps = [
description: 'Show dial code in the dropdown selection',
inDemo: true,
},
{
name: 'dropdownOptions.hideSelection',
default: false,
type: Boolean,
description: 'Hide the select button from the list',
inDemo: true,
},
{
name: 'dropdownOptions.showFlags',
default: true,
Expand Down