Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core,platform): missing class on split button #8034

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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