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

feat: allow disabling selected item events #1297

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

korczas
Copy link

@korczas korczas commented Jul 29, 2021

What:

New feature, which supports disabled prop for getSelectedItemProps method.

Why:

When using useMultipleSelection() hook there is no support for disabling Backspace and Delete keys events and prevent from editing data.

How:

If disabled prop is passed to getSelectedItemProps, then onClick and onKeyDown handlers are not returned.

Checklist:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@silviuaavram
Copy link
Collaborator

Hi! We don't support disabled on useMultipleSelection but I think it's a good idea to have it! Can you create a Feature Request?

@korczas
Copy link
Author

korczas commented Jul 30, 2021

@silviuaavram Hi. I am not sure if I understood correctly what u meant by creating a Feature Request, by I have updated PR description with the template, added TS definition and updated docs. It seems that flow-types doesn't need any update, but I might be wrong.

@korczas
Copy link
Author

korczas commented Aug 16, 2021

@silviuaavram Hi, feature is ready to ship.

@Lelith
Copy link

Lelith commented Jan 17, 2022

Hey i wanted to ask what the status of this pull request is, as i would be also interested in the possibility to disable some of my elements from a list for selection.

@korczas
Copy link
Author

korczas commented Jan 21, 2022

@silviuaavram

@silviuaavram
Copy link
Collaborator

Well yes, all good so far, thank you! But if the item is disabled, it should be skipped during navigation. This PR needs more work and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants