Skip to content

Commit

Permalink
feat: allow passing of width [style]="{width: '100%'}". Allows sett…
Browse files Browse the repository at this point in the history
…ing 100% width closes #199
  • Loading branch information
scttcper committed Mar 14, 2019
1 parent 3aecbd9 commit 1022142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/picker/picker.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="emoji-mart"
[style.width.px]="perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar"
[style.width]="getWidth()"
[ngStyle]="style">
<div class="emoji-mart-bar">
<emoji-mart-anchors
Expand Down
6 changes: 6 additions & 0 deletions src/lib/picker/picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,10 @@ export class PickerComponent implements OnInit {
localStorage.setItem(`${this.NAMESPACE}.skin`, String(skin));
this.skinChange.emit(skin);
}
getWidth(): string {
if (this.style.width) {
return this.style.width;
}
return this.perLine * (this.emojiSize + 12) + 12 + 2 + this.measureScrollbar + 'px';
}
}

0 comments on commit 1022142

Please sign in to comment.