Skip to content

Commit

Permalink
Chips | placeholder prop
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Aug 12, 2022
1 parent 62f45a7 commit 8ff6f37
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api-generator/components/chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const ChipsProps = [
default: "false",
description: "When present, it specifies that the element should be disabled."
},
{
name: "placeholder",
type: "string",
default: "null",
description: "Placeholder text for the input."
},
{
name: "inputId",
type: "string",
Expand Down
4 changes: 4 additions & 0 deletions src/components/chips/Chips.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export interface ChipsProps {
* When present, it specifies that the element should be disabled.
*/
disabled?: boolean | undefined;
/**
* Placeholder text for the input.
*/
placeholder?: string | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
*/
Expand Down
6 changes: 5 additions & 1 deletion src/components/chips/Chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span class="p-chips-token-icon pi pi-times-circle" @click="removeItem($event, i)" aria-hidden="true"></span>
</li>
<li class="p-chips-input-token" role="option">
<input ref="input" type="text" :id="inputId" :class="inputClass" :style="inputStyle" :disabled="disabled || maxedOut"
<input ref="input" type="text" :id="inputId" :class="inputClass" :style="inputStyle" :disabled="disabled || maxedOut" :placeholder="placeholder"
@focus="onFocus($event)" @blur="onBlur($event)" @input="onInput" @keydown="onKeyDown($event)" @paste="onPaste($event)" v-bind="inputProps">
</li>
</ul>
Expand Down Expand Up @@ -44,6 +44,10 @@ export default {
type: Boolean,
default: true
},
placeholder: {
type: String,
default: null
},
inputId: null,
inputClass: null,
inputStyle: null,
Expand Down
6 changes: 6 additions & 0 deletions src/views/chips/ChipsDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ import Chips from 'primevue/chips';
<td>false</td>
<td>When present, it specifies that the element should be disabled.</td>
</tr>
<tr>
<td>placeholder</td>
<td>string</td>
<td>null</td>
<td>Placeholder text for the input.</td>
</tr>
<tr>
<td>inputId</td>
<td>string</td>
Expand Down

0 comments on commit 8ff6f37

Please sign in to comment.