Skip to content
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