Skip to content

Commit

Permalink
Add placeholder attribute in canary-input
Browse files Browse the repository at this point in the history
  • Loading branch information
yujonglee committed Oct 29, 2024
1 parent 3c5d973 commit 5bab7e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions js/packages/web/.changeset/fuzzy-hotels-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@getcanary/web": patch
---

Add placeholder attribute in canary-input.
5 changes: 4 additions & 1 deletion js/packages/web/src/components/canary-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class CanaryInput extends LitElement {
@property({ type: Boolean })
autofocus = false;

@property({ type: String })
placeholder = "Search for anything...";

@consume({ context: queryContext, subscribe: true })
@state()
private _query: QueryContext = { text: "", tags: [] };
Expand Down Expand Up @@ -94,7 +97,7 @@ export class CanaryInput extends LitElement {
.value=${this._query.text}
autocomplete="off"
spellcheck="false"
placeholder="Search for anything..."
placeholder=${this.placeholder}
@input=${this._handleInput}
@keydown=${this._handleKeyDown}
onfocus="this.setSelectionRange(this.value.length,this.value.length);"
Expand Down

0 comments on commit 5bab7e4

Please sign in to comment.