Skip to content

Commit 402d94a

Browse files
authored
Commit Action Button - Fix separator when button is disabled (microsoft#154781)
* Fix separator when button is disabled * Pull request feedback
1 parent 9925e5d commit 402d94a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/vs/base/browser/ui/button/button.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@
3838
cursor: pointer;
3939
}
4040

41+
.monaco-button-dropdown.disabled {
42+
cursor: default;
43+
}
44+
4145
.monaco-button-dropdown > .monaco-button:focus {
4246
outline-offset: -1px !important;
4347
}
4448

49+
.monaco-button-dropdown.disabled .monaco-button-dropdown-separator {
50+
opacity: 0.4;
51+
}
52+
4553
.monaco-button-dropdown .monaco-button-dropdown-separator {
4654
padding: 4px 0;
4755
}

src/vs/base/browser/ui/button/button.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ export class ButtonWithDropdown extends Disposable implements IButton {
299299
set enabled(enabled: boolean) {
300300
this.button.enabled = enabled;
301301
this.dropdownButton.enabled = enabled;
302+
303+
this.element.classList.toggle('disabled', !enabled);
302304
}
303305

304306
get enabled(): boolean {

0 commit comments

Comments
 (0)