Skip to content

Commit

Permalink
feat(VDialog): add retainFocus prop
Browse files Browse the repository at this point in the history
fixes #6892
see 513cb56
see 2d5d72b
  • Loading branch information
KaelWD committed Jul 20, 2019
1 parent d7594b9 commit 3681cd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/docs/src/lang/en/components/Dialogs.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"openOnHover": "Designates whether component should activate when its activator is hovered.",
"origin": "Mixins.Transitionable.props.origin",
"persistent": "Clicking outside of the element will not deactivate it.",
"retainFocus": "Tab focus will return to the first child of the dialog by default. Disable this when using external tools that require focus such as TinyMCE or vue-clipboard.",
"scrollable": "When set to true, expects a `v-card` and a `v-card-text` component with a designated height. For more information, check out the [scrollabe example](/components/dialogs#scrollable).",
"transition": "Mixins.Transitionable.props.transition",
"width": "Mixins.Measurable.props.width"
Expand Down
6 changes: 5 additions & 1 deletion packages/vuetify/src/components/VDialog/VDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export default baseMixins.extend({
default: 'center center',
},
persistent: Boolean,
retainFocus: {
type: Boolean,
default: true,
},
scrollable: Boolean,
transition: {
type: [String, Boolean],
Expand Down Expand Up @@ -200,7 +204,7 @@ export default baseMixins.extend({
this.$emit('keydown', e)
},
onFocusin (e: Event) {
if (!e) return
if (!e || !this.retainFocus) return

const target = e.target as HTMLElement

Expand Down

0 comments on commit 3681cd5

Please sign in to comment.