Skip to content

Commit 9c9e8bb

Browse files
committed
fix(ui-drilldown): disabled options no longer show hover/focus styles
Closes: INSTUI-5077
1 parent a08bb3e commit 9c9e8bb

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

packages/ui-drilldown/src/Drilldown/v1/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,13 +1258,9 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
12581258
optionProps.role = customRole || 'menuitemcheckbox'
12591259
}
12601260
}
1261-
// display option as highlighted
1262-
if (id === this.state.highlightedOptionId) {
1261+
// display option as highlighted, but never highlight disabled options
1262+
if (id === this.state.highlightedOptionId && !isOptionDisabled) {
12631263
optionProps.variant = 'highlighted'
1264-
1265-
if (isOptionDisabled) {
1266-
optionProps.variant = 'highlighted-disabled'
1267-
}
12681264
}
12691265

12701266
if (href) {

packages/ui-drilldown/src/Drilldown/v2/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,13 +1255,9 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
12551255
optionProps.role = customRole || 'menuitemcheckbox'
12561256
}
12571257
}
1258-
// display option as highlighted
1259-
if (id === this.state.highlightedOptionId) {
1258+
// display option as highlighted, but never highlight disabled options
1259+
if (id === this.state.highlightedOptionId && !isOptionDisabled) {
12601260
optionProps.variant = 'highlighted'
1261-
1262-
if (isOptionDisabled) {
1263-
optionProps.variant = 'highlighted-disabled'
1264-
}
12651261
}
12661262

12671263
if (href) {

0 commit comments

Comments
 (0)