Skip to content

Commit

Permalink
docs: fix combobox usage as command
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Jan 29, 2025
1 parent d2e66d5 commit 31331bc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/content/docs/components/combobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ See the [virtualization guide](../guides/virtualization.md) for more general inf

```vue line=9-10,17,19-28
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ComboboxContent, ComboboxViewport, ComboboxInput, ComboboxItem, ComboboxPortal, ComboboxRoot, ComboboxVirtualizer, useFilter } from 'reka-ui'
import { computed, ref } from 'vue'
import { ComboboxContent, ComboboxInput, ComboboxItem, ComboboxPortal, ComboboxRoot, ComboboxViewport, ComboboxVirtualizer, useFilter } from 'reka-ui'
const people = Array.from({ length: 100000 }).map((_, id) => ({ id, name: `Person #${id}` }));
const people = Array.from({ length: 100000 }).map((_, id) => ({ id, name: `Person #${id}` }))
const selectedPeople = ref(people[0])
const searchTerm = ref('')
Expand Down Expand Up @@ -711,7 +711,12 @@ const forward = useForwardPropsEmits(props, emits)
<ComboboxInput placeholder="Type a command or search…" />
<ComboboxPortal>
<ComboboxContent>
<ComboboxContent
@escape-key-down.prevent
@focus-outside.prevent
@interact-outside.prevent
@pointer-down-outside.prevent
>
<ComboboxViewport>
<slot />
</ComboboxViewport>
Expand Down

0 comments on commit 31331bc

Please # to comment.