Skip to content

Commit

Permalink
fix(core,platform): fixed split button missing class (#8034)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-cheishvili authored and platon-rov committed May 16, 2022
1 parent ace2ad7 commit f9d8c23
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions libs/core/src/lib/split-button/split-button.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div
class="fd-button-split fd-has-margin-right-small"
[ngClass]="typeClass"
role="group"
tabindex="-1"
[attr.aria-label]="arialLabel"
Expand Down
8 changes: 0 additions & 8 deletions libs/core/src/lib/split-button/split-button.component.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
@import '~fundamental-styles/dist/button-split';

// Remove after merging https://github.com/SAP/fundamental-styles/issues/2163
.fd-button-split,
.fd-button-split > :first-child:hover {
.fd-button-split__text {
color: inherit;
}
}
5 changes: 5 additions & 0 deletions libs/core/src/lib/split-button/split-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ export class SplitButtonComponent implements AfterContentInit, OnChanges, OnDest
/** @hidden */
mainButtonWidth: string;

/** @hidden */
get typeClass(): string {
return this.fdType ? `fd-button-split--${this.fdType}` : '';
}

/** @hidden */
private _menuItemSubscriptions = new Subscription();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div
class="fd-button-split"
[class]="typeClass"
role="group"
aria-label="split-button"
[attr.dir]="dir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export class SplitMenuButtonComponent extends BaseComponent implements OnInit, A
* @hidden */
private _rtlChangeSubscription = Subscription.EMPTY;

/** @hidden */
get typeClass(): string {
return this.type ? `fd-button-split--${this.type}` : '';
}

constructor(protected _cd: ChangeDetectorRef, @Optional() private _rtlService: RtlService) {
super(_cd);
}
Expand Down

0 comments on commit f9d8c23

Please sign in to comment.