Skip to content

Commit 919df7c

Browse files
committed
feat: noAutoFocus
1 parent 86a916f commit 919df7c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/docs/src/api/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ Boolean: prevent the popper from overflowing the `boundary` by adjusting its pos
460460
<VDropdown shift-cross-axis />
461461
```
462462

463+
### `noAutoFocus`
464+
465+
Boolean: disable the auto focus on the popper DOM node when shown.
466+
467+
```vue
468+
<VDropdown no-auto-focus />
469+
```
470+
463471
### `ariaId`
464472

465473
Id used for the `aria-describedby` attribute. By default a random id.

packages/floating-vue/src/components/Popper.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ export default () => defineComponent({
261261
type: Boolean,
262262
default: defaultPropFactory('shiftCrossAxis'),
263263
},
264+
265+
noAutoFocus: {
266+
type: Boolean,
267+
default: defaultPropFactory('noAutoFocus'),
268+
},
264269
},
265270

266271
emits: [
@@ -773,7 +778,7 @@ export default () => defineComponent({
773778
await nextFrame()
774779
this.classes.showFrom = false
775780
this.classes.showTo = true
776-
this.$_popperNode.focus()
781+
if (!this.noAutoFocus) this.$_popperNode.focus()
777782
},
778783

779784
async $_applyHide (skipTransition = false) {

0 commit comments

Comments
 (0)