Skip to content

Commit 45a1a27

Browse files
authored
feat(text-input): placeholder (#2595)
Closes #2594
1 parent 25a229b commit 45a1a27

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/elements": minor
3+
---
4+
`<pf-text-input>`: added `placeholder` attribute

elements/pf-text-input/pf-text-input.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ export class PfTextInput extends LitElement {
188188
/** Flag to show if the input is read only. */
189189
@property({ type: Boolean, reflect: true }) readonly = false;
190190

191+
/** Input placeholder. */
192+
@property() placeholder?: string;
193+
191194
/** Value of the input. */
192195
@property() value = '';
193196

@@ -217,6 +220,7 @@ export class PfTextInput extends LitElement {
217220
?readonly="${this.readonly}"
218221
?required="${this.required}"
219222
aria-label="${this.#derivedLabel}"
223+
placeholder="${ifDefined(this.placeholder)}"
220224
type="${ifDefined(this.type)}"
221225
.value="${this.value}"
222226
style="${ifDefined(this.customIconUrl && styleMap({

0 commit comments

Comments
 (0)