Skip to content

Commit

Permalink
Fix combobox examples using labels as value (#1788)
Browse files Browse the repository at this point in the history
Fix #1785
  • Loading branch information
miquelvir authored Oct 21, 2023
1 parent 5cadc5e commit 35f776d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/www/content/docs/components/combobox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export function ComboboxDemo() {
{frameworks.map((framework) => (
<CommandItem
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? "" : currentValue)
setOpen(false)
Expand Down
1 change: 1 addition & 0 deletions apps/www/registry/default/example/combobox-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default function ComboboxDemo() {
{frameworks.map((framework) => (
<CommandItem
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? "" : currentValue)
setOpen(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default function ComboboxDropdownMenu() {
{labels.map((label) => (
<CommandItem
key={label}
value={label}
onSelect={(value) => {
setLabel(value)
setOpen(false)
Expand Down
1 change: 1 addition & 0 deletions apps/www/registry/default/example/combobox-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function ComboboxPopover() {
{statuses.map((status) => (
<CommandItem
key={status.value}
value={status.value}
onSelect={(value) => {
setSelectedStatus(
statuses.find((priority) => priority.value === value) ||
Expand Down
1 change: 1 addition & 0 deletions apps/www/registry/new-york/example/combobox-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default function ComboboxDemo() {
{frameworks.map((framework) => (
<CommandItem
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? "" : currentValue)
setOpen(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default function ComboboxDropdownMenu() {
{labels.map((label) => (
<CommandItem
key={label}
value={label}
onSelect={(value) => {
setLabel(value)
setOpen(false)
Expand Down
1 change: 1 addition & 0 deletions apps/www/registry/new-york/example/combobox-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default function ComboboxPopover() {
{statuses.map((status) => (
<CommandItem
key={status.value}
value={status.value}
onSelect={(value) => {
setSelectedStatus(
statuses.find((priority) => priority.value === value) ||
Expand Down

1 comment on commit 35f776d

@vercel
Copy link

@vercel vercel bot commented on 35f776d Oct 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ui – ./apps/www

ui-shadcn-pro.vercel.app
example-playground.vercel.app
ui-git-main-shadcn-pro.vercel.app
ui.shadcn.com

Please sign in to comment.