Skip to content

Commit

Permalink
feat: noAutoFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 8, 2022
1 parent 86a916f commit 919df7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/docs/src/api/README.md
Expand Up @@ -460,6 +460,14 @@ Boolean: prevent the popper from overflowing the `boundary` by adjusting its pos
<VDropdown shift-cross-axis />
```

### `noAutoFocus`

Boolean: disable the auto focus on the popper DOM node when shown.

```vue
<VDropdown no-auto-focus />
```

### `ariaId`

Id used for the `aria-describedby` attribute. By default a random id.
Expand Down
7 changes: 6 additions & 1 deletion packages/floating-vue/src/components/Popper.ts
Expand Up @@ -261,6 +261,11 @@ export default () => defineComponent({
type: Boolean,
default: defaultPropFactory('shiftCrossAxis'),
},

noAutoFocus: {
type: Boolean,
default: defaultPropFactory('noAutoFocus'),
},
},

emits: [
Expand Down Expand Up @@ -773,7 +778,7 @@ export default () => defineComponent({
await nextFrame()
this.classes.showFrom = false
this.classes.showTo = true
this.$_popperNode.focus()
if (!this.noAutoFocus) this.$_popperNode.focus()
},

async $_applyHide (skipTransition = false) {
Expand Down

0 comments on commit 919df7c

Please sign in to comment.