fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Feature Request] Offer a way to disable selections on a Selection instance

Open Nimelrian opened this issue 9 years ago • 3 comments

Use case: I have a DetailList which is inside a component tree the user can "disable":

<ActivatableSection>
  <DataProvider>
    <DetailList />
  </DataProvider>
</ActivatableSection>

The DataProvider component manages the Selection instance which is passed to DetailList.

If the section is disabled, I don't want to be able to change the selection of the List's items. Right now I check in the DataProvider during the onSelectionChange handler if the disabled prop is set and run a forceUpdate on the Provider to reassign the selected keys to their old value, but this isn't really clean. Is it possible to add a function setDisabled or something like that to provide a clean way to disable selections?

Nimelrian avatar Nov 10 '17 15:11 Nimelrian

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 07:04 stale[bot]

@Nimelrian - there is a selectionMode prop on the DetailsList and you can set it to SelectionMode.None. Using this may be a cleaner way to disable selection on the list conditionally.

aditima avatar May 02 '18 21:05 aditima

Hopefully that answers your question. Closing due to no recent activity.

aditima avatar May 31 '18 23:05 aditima