Skip to content

Commit

Permalink
docs: combobx add prevent select behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Oct 23, 2023
1 parent e1c44b2 commit d0fe403
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/content/components/combobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -955,9 +955,32 @@ import {
</template>
```

### Prevent select behavior

By default, selecting `ComboboxItem` would close the content, and update the `modelValue` with the provided value.
You can prevent this behavior by preventing default `@select.prevent`.


```vue line=11
<script setup lang="ts">
import { ref } from 'vue'
import { ComboboxContent, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxPortal, ComboboxRoot } from 'radix-vue'
</script>
<template>
<ComboboxRoot>
<ComboboxInput />
<ComboboxPortal>
<ComboboxContent>
<ComboboxItem @select.prevent>
Item A
</ComboboxItem>
</ComboboxContent>
</ComboboxPortal>
</ComboboxRoot>
</template>
```

## Accessibility

Expand Down

0 comments on commit d0fe403

Please sign in to comment.