Skip to content

Commit 6d40bcd

Browse files
author
MPopov
committed
fix(button-group): Add ellipsis
1 parent a1ee7e1 commit 6d40bcd

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

projects/igniteui-angular/src/lib/buttonGroup/buttongroup-content.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
[igxLabel]="button.label"
1212
[igxRipple]="button.ripple"
1313
>
14-
<div class="igx-button-group__item-content {{ itemContentCssClass }}">
14+
<span class="igx-button-group__item-content {{ itemContentCssClass }}">
1515
<igx-icon *ngIf="button.icon" fontSet="material">{{button.icon}}</igx-icon>
16-
<span *ngIf="button.label">{{button.label}}</span>
17-
</div>
16+
<span class="igx-button-group__button-text" *ngIf="button.label">{{button.label}}</span>
17+
</span>
1818
</button>
1919
<ng-content></ng-content>
2020
</div>

projects/igniteui-angular/src/lib/core/styles/components/button-group/_button-group-component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
@extend %igx-group-item !optional;
1616
}
1717

18+
@include e(button-text) {
19+
@extend %igx-button-group__button-text !optional;
20+
}
21+
1822
@include e(item, $m: selected) {
1923
@extend %igx-group-item !optional;
2024
@extend %igx-group-item-selected !optional;

projects/igniteui-angular/src/lib/core/styles/components/button-group/_button-group-theme.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@
185185
display: flex;
186186
box-shadow: --var($theme, 'shadow');
187187
transition: $transition;
188-
border-radius: --var($theme, 'border-radius')
188+
border-radius: --var($theme, 'border-radius');
189189
}
190190

191191
%igx-group-item {
192-
@include ellipsis();
193192
border: $group-item-border-thickness solid --var($theme, 'item-border-color');
194193
color: --var($theme, 'item-text-color');
195194
background: --var($theme, 'item-background');
@@ -307,13 +306,16 @@
307306
%igx-group-item-content {
308307
display: flex;
309308
flex-flow: row nowrap;
310-
justify-content: center;
311-
align-items: center;
312-
text-align: center;
309+
min-width: 0;
313310

314311
* ~ * {
315312
margin-#{$left}: $group-items-margin;
316313
}
317314
}
315+
316+
%igx-button-group__button-text {
317+
width: 100%;
318+
@include ellipsis();
319+
}
318320
}
319321

src/app/buttonGroup/buttonGroup.sample.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,14 @@ <h4 class="sample-title">Custom class to style the content</h4>
4646
<article class="sample-column">
4747
<h4 class="sample-title">Templated buttons.</h4>
4848
<igx-buttongroup [multiSelection]="false">
49-
<button igxButton><igx-icon>alarm_on</igx-icon>Button 1 text</button>
50-
<button igxButton><igx-icon>autorenew</igx-icon>Button 2 text</button>
49+
<button igxButton>
50+
<igx-icon>alarm_on</igx-icon>
51+
Button 1 text
52+
</button>
53+
<button igxButton>
54+
<igx-icon>autorenew</igx-icon>
55+
Button 2 text<
56+
</button>
5157
</igx-buttongroup>
5258
</article>
5359

0 commit comments

Comments
 (0)