fix(autocomplete): support isReadOnly for dynamic collections in Autocomplete#2458
Conversation
🦋 Changeset detectedLatest commit: fdf492a The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@wingkwong is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
|
@wingkwong please remove the |
|
@jrgarciadev the example in the docs is not included in this PR but PR#2444, which is not merged. I just used it to demonstrate the before & after only. |
| "@nextui-org/autocomplete": patch | ||
| "@nextui-org/dropdown": patch | ||
| "@nextui-org/popover": patch | ||
| "@nextui-org/tooltip": patch |
There was a problem hiding this comment.
@wingkwong why are we upgrading packages outside the autocomplete one?
There was a problem hiding this comment.
@jrgarciadev changeset shows these are changed tho, or I just include autocomplete one?
There was a problem hiding this comment.
Let's include all the changed packages "just in case", but it should only detect the autocomplete
| "@nextui-org/autocomplete": patch | ||
| "@nextui-org/dropdown": patch | ||
| "@nextui-org/popover": patch | ||
| "@nextui-org/tooltip": patch |
There was a problem hiding this comment.
Let's include all the changed packages "just in case", but it should only detect the autocomplete
Closes #2457
📝 Description
Currently
isReadOnlyfor autocomplete only works for static collections. If we use dynamic ones, it will fail becausechildrenis not iterable. This PR is to retrieve the keys fromstate.collectionsince the keys are unknown for dynamic one at the first place. In this way, it should cover static, dynamic, controlled cases.The following behaviour is using the doc changes done in PR #2444 to demonstrate.
⛳️ Current behavior (updates)
See
apps/docs/content/components/autocomplete/read-only.ts🚀 New behavior
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information