Skip to content

Commit

Permalink
Added inputType prop #108 #116
Browse files Browse the repository at this point in the history
  • Loading branch information
adamberecz committed Sep 9, 2021
1 parent 8430e47 commit 2093e6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Join our [Discord channel](https://discord.gg/WhX2nG6GTQ) or [open an issue](htt
| **placeholder** | `string` | `null` | The text that should be displayed before any option is selected. |
| **multipleLabel** | `function` | | A function that returns the label to be displayed for selected options when using `multiple` mode. It receives `value` as an argument. By default it renders `1 option selected` and `[n] options selected` based on `value` length. |
| **disabled** | `boolean` | `false` | Whether the input should be disabled for the user (API can still be used programmatically). |
| **inputType** | `string` | `text` | The `type` attribute of search input. |
| **max** | `number` | `-1` | The maximum number of options that **can be selected** when using `multiple` or `tags` mode. If `-1` the number of options won't be limited. |
| **limit** | `number` | `-1` | The maximum number of options that **should be displayed**. If `-1` the number of options won't be limited. |
| **loading** | `boolean` | `false` | Whether a loading spinner should be shown. |
Expand Down
1 change: 1 addition & 0 deletions src/Multiselect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ declare class Multiselect extends Vue {
groupOptions: string;
groupHideEmpty: boolean;
groupSelect: boolean;
inputType: string;

$emit(eventName: 'change', e: {originalEvent: Event, value: any}): this;
$emit(eventName: 'select', e: {originalEvent: Event, value: any, option: any}): this;
Expand Down
9 changes: 7 additions & 2 deletions src/Multiselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Search -->
<template v-if="mode !== 'tags' && searchable && !disabled">
<input
type="search"
:type="inputType"
:modelValue="search"
:value="search"
:class="classList.search"
Expand Down Expand Up @@ -53,7 +53,7 @@
<!-- Actual search input -->
<input
v-if="searchable && !disabled"
type="search"
:type="inputType"
:modelValue="search"
:value="search"
:class="classList.tagsSearch"
Expand Down Expand Up @@ -431,6 +431,11 @@
required: false,
default: true,
},
inputType: {
type: String,
required: false,
default: 'text',
}
},
setup(props, context)
{
Expand Down

0 comments on commit 2093e6c

Please sign in to comment.