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

Dynamic DropZone allow/disallow #669

Open
chrisvxd opened this issue Oct 24, 2024 · 0 comments
Open

Dynamic DropZone allow/disallow #669

chrisvxd opened this issue Oct 24, 2024 · 0 comments

Comments

@chrisvxd
Copy link
Member

chrisvxd commented Oct 24, 2024

Currently, the allow / disallow API on DropZone is static. This makes more sophisticated conditions difficult, such as restricting the insert of an item based on the number of that component type already in the DropZone.

Proposal

New canInsert API

A new API to dynamically resolve the allow/disallow list. Probably needs a better name.

<DropZone canInsert={(componentType, content) => {
  return !content.find(item => item.type === componentType)
}} />

Notes

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

No branches or pull requests

1 participant