Skip to content

DetailsList "data-selection-disabled" doesn't work.  #4077

Description

@bva999

Bug Report

When I added custom column with component in DetailsList and added attribute "data-selection-disabled = {true}" the selection is still react.

private _buildColumns(items : any[], sortedColumn?: IColumn): IColumn[] {
    let columns : IColumn[] = [];
    columns.push({
        key: "editItem",
        name: "",
        fieldName: "",
        minWidth: 25,
        onRender: (item) =>(
          <Link
            data-selection-disabled={ true }
            key={ item }
            href="#"
            onClick={ () => window.location.href = "../SitePages/Test.aspx" }>
          Edit
          </Link>
        )
      });
    return columns;
}

My DetailsList:

<DetailsList
        items={this.state.items}
        setKey="items"
        selectionPreservedOnEmptyClick={ true }
        columns={this.state.columns}
        layoutMode={DetailsListLayoutMode.justified}
        onRenderMissingItem={(index) => this._onDataMiss}
        selection={this._selection}
        onItemInvoked={this._onItemInvoked}
        onColumnHeaderClick={this._onColumnClick}/>

Also doesn't work example Rendering custom item columns with sorting .

case 'color':
      return <span data-selection-disabled={ true } style={ { color: fieldContent } }>{ fieldContent }</span>;

But when you click on color , selection reacts.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions