Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: DetailsList Selected property not blanked when removing selected record #451

Open
e-gallis opened this issue Mar 6, 2024 · 3 comments
Assignees
Labels
bug Something isn't working 👋 needs author feedback Waiting on a response from the author

Comments

@e-gallis
Copy link

e-gallis commented Mar 6, 2024

Describe the bug
After removing a selected record from the list's records, the Selected property still holds the data of the deleted record.

To Reproduce
Steps to reproduce the behavior:

  1. Add a DetailsList control to the screen
  2. Provide the control with a set of records through a collection
  3. Add a button on the screen with a piece of code to remove the selected record from the collection
  4. The record is removed from the list but the Selected property still holds the deleted record

Expected behavior
The Selected property should be cleared if the currently selected record is removed from the list (that is, when no records are selected)

Screenshots
N/A

Additional context
N/A

AB#2489

@e-gallis e-gallis added bug Something isn't working ⚠️ needs triage Has not been triaged by the team yet. labels Mar 6, 2024
@e-gallis
Copy link
Author

e-gallis commented Mar 6, 2024

Anyone with any idea on how to workaround this issue meanwhile?

@denise-msft denise-msft added this to the Creator Kit - May 2024 milestone May 1, 2024
@denise-msft
Copy link
Member

@e-gallis would it work to update the collection to 'reset' after deletion by selecting the first item in the list instead of clearing out? Have you tried that scenario, or would there be any reason why that is inappropriate for your workflow?

@denise-msft denise-msft self-assigned this Jun 18, 2024
@denise-msft denise-msft added 👋 needs author feedback Waiting on a response from the author and removed ⚠️ needs triage Has not been triaged by the team yet. labels Jun 18, 2024
@e-gallis
Copy link
Author

Hi @denise-msft,
Indeed this would be inappropriate. Here is my scenario:

  • I have a DetailsList component listing a set of records from a collection
  • The application allows me to delete a selected record
  • After the record has been removed from the collection there should be no more record selected -> therefore I expect the Selected property to be blank
    You can find the same behavior on Microsoft Lists: deleting an item does not select the first item in the list after deletion. There is just no other item selected.
    I expect the same from the DetailsList component. Well, I suppose it is a "standard behavior" throughout web applications in general.
    Hope this helps... 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 👋 needs author feedback Waiting on a response from the author
Projects
None yet
Development

No branches or pull requests

2 participants