Skip to content

Commit

Permalink
fix: Allow data-selection-disabled to be respected by DetailsRow (#25836
Browse files Browse the repository at this point in the history
)

* fix: Allow data-selection-disabled to be respected by DetailsRow.

* Adding change file.

Co-authored-by: Humberto Makoto Morimoto Burgos <[email protected]>
  • Loading branch information
khmakoto and Humberto Makoto Morimoto Burgos authored Nov 29, 2022
1 parent 678f8db commit 60b2e7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: Allow data-selection-disabled to be respected by DetailsRow.",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 3 additions & 5 deletions packages/react/src/components/DetailsList/DetailsRow.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class DetailsRowBase extends React.Component<IDetailsRowBaseProps, IDetai
className={this._classNames.root}
data-selection-index={itemIndex}
data-selection-touch-invoke={true}
data-selection-disabled={disabled || undefined}
data-selection-disabled={(this.props as any)['data-selection-disabled'] ?? (disabled || undefined)}
data-item-index={itemIndex}
aria-rowindex={ariaPositionInSet === undefined ? itemIndex + flatIndexOffset : undefined}
data-automationid="DetailsRow"
Expand All @@ -354,7 +354,7 @@ export class DetailsRowBase extends React.Component<IDetailsRowBaseProps, IDetai
className: this._classNames.check,
theme,
isVisible: checkboxVisibility === CheckboxVisibility.always,
onRenderDetailsCheckbox: onRenderDetailsCheckbox,
onRenderDetailsCheckbox,
useFastIcons,
})}
</div>
Expand Down Expand Up @@ -432,9 +432,7 @@ export class DetailsRowBase extends React.Component<IDetailsRowBaseProps, IDetai
const selectionState = getSelectionState(this.props);

if (!shallowCompare(selectionState, this.state.selectionState)) {
this.setState({
selectionState: selectionState,
});
this.setState({ selectionState });
}
};

Expand Down

0 comments on commit 60b2e7d

Please sign in to comment.