Skip to content

Do not select disabled items#3126

Closed
snowystinger wants to merge 4 commits intomainfrom
do-not-select-disabled-items
Closed

Do not select disabled items#3126
snowystinger wants to merge 4 commits intomainfrom
do-not-select-disabled-items

Conversation

@snowystinger
Copy link
Copy Markdown
Member

Closes

Fixes an issue noticed in #3123 where dragging a disabled item to a new list where it was still disabled caused it to become selected.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

Copy link
Copy Markdown
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and confirmed that onSelectionChange doesn't fire for disabled rows now (e.g. highlight selection ListView fired onSelectionChange when keyboard navigating to a disabled row). Mind writing a test for TableView + ListView to cover that case?

});
});

describe('drag and drop', function () {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed drag and drop into its own file so this file wouldn't end up like TableView's tests

});


it('should not select disabled items', async function () {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only new test I added

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@snowystinger snowystinger added the small review Easy to review PR label May 16, 2022
Copy link
Copy Markdown
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for organizing the tests!

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@snowystinger
Copy link
Copy Markdown
Member Author

Closing as #3123 also handled it

@snowystinger snowystinger deleted the do-not-select-disabled-items branch May 23, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ListView small review Easy to review PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants