Skip to content

fix(autocomplete): support isReadOnly for dynamic collections in Autocomplete#2458

Merged
jrgarciadev merged 1 commit into
heroui-inc:mainfrom
wingkwong:fix/eng-468
Mar 8, 2024
Merged

fix(autocomplete): support isReadOnly for dynamic collections in Autocomplete#2458
jrgarciadev merged 1 commit into
heroui-inc:mainfrom
wingkwong:fix/eng-468

Conversation

@wingkwong
Copy link
Copy Markdown
Member

@wingkwong wingkwong commented Mar 6, 2024

Closes #2457

📝 Description

Currently isReadOnly for autocomplete only works for static collections. If we use dynamic ones, it will fail because children is not iterable. This PR is to retrieve the keys from state.collection since 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

image

🚀 New behavior

image

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

@wingkwong wingkwong requested a review from jrgarciadev as a code owner March 6, 2024 04:34
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: fdf492a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@nextui-org/autocomplete Patch
@nextui-org/dropdown Patch
@nextui-org/popover Patch
@nextui-org/tooltip Patch
@nextui-org/react Patch
@nextui-org/select Patch
@nextui-org/slider Patch
@nextui-org/snippet Patch

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 4:37am

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 6, 2024

@wingkwong is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@jrgarciadev
Copy link
Copy Markdown
Member

@wingkwong please remove the isReadOnly example in the docs until we release the next version

@wingkwong
Copy link
Copy Markdown
Member Author

wingkwong commented Mar 6, 2024

@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.

Comment on lines +2 to +5
"@nextui-org/autocomplete": patch
"@nextui-org/dropdown": patch
"@nextui-org/popover": patch
"@nextui-org/tooltip": patch
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wingkwong why are we upgrading packages outside the autocomplete one?

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.

@jrgarciadev changeset shows these are changed tho, or I just include autocomplete one?

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's include all the changed packages "just in case", but it should only detect the autocomplete

Comment on lines +2 to +5
"@nextui-org/autocomplete": patch
"@nextui-org/dropdown": patch
"@nextui-org/popover": patch
"@nextui-org/tooltip": patch
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's include all the changed packages "just in case", but it should only detect the autocomplete

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - isReadOnly not supported in Dynamic items in Autocomplete

2 participants