Skip to content

Commit

Permalink
Show placeholder again after removeAll()
Browse files Browse the repository at this point in the history
  • Loading branch information
okcoker committed Feb 2, 2017
1 parent ba7aa7d commit dc32961
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/taggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@
this._remove(this.tag.elements[i]);
}

if (this.placeholder) {
this.placeholder.style.opacity = 1;
}

return this;
};

Expand Down
6 changes: 6 additions & 0 deletions test/taggle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,12 @@ describe('Taggle', function() {
expect(this.instance.getTagElements().length).to.equal(1);
expect(this.instance.getTagValues().length).to.equal(1);
});

it('should cause the placeholder to reappear', function() {
this.instance.removeAll();

expect(this.instance.placeholder.style.opacity).to.equal('1');
});
});

describe('#checkCloseButtonType', function() {
Expand Down

1 comment on commit dc32961

@okcoker
Copy link
Owner Author

@okcoker okcoker commented on dc32961 Feb 2, 2017

Choose a reason for hiding this comment

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

#88

Please sign in to comment.