Skip to content

Commit

Permalink
check if there is value/option already selected before placing the pl…
Browse files Browse the repository at this point in the history
…aceholder in the input, to avoid the issue where it appears in the background of the input
  • Loading branch information
animena committed Jan 11, 2024
1 parent b3feabb commit 5edee4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ class HSSelect extends HSBasePlugin<ISelectOptions> implements ISelect {

private buildTagsInput() {
this.tagsInput = document.createElement('input');
(this.tagsInput as HTMLInputElement).placeholder = this.placeholder;

if (!this.value.length)
(this.tagsInput as HTMLInputElement).placeholder = this.placeholder;

if (this.tagsInputClasses)
classToClassList(this.tagsInputClasses, this.tagsInput);

Expand Down

1 comment on commit 5edee4a

@animena
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if there is a value/option already selected before placing the placeholder in the input, to avoid the issue where it appears in the background of the input

Please sign in to comment.