Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yariksav committed Jun 16, 2020
1 parent a9dd8b7 commit 4655cf4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuetify-dialog",
"version": "2.0.5",
"version": "2.0.6",
"description": "Dialog helper for vuetify.js",
"scripts": {
"build": "npm run build:umd & npm run build:es & npm run build:unpkg",
Expand Down Expand Up @@ -69,7 +69,7 @@
"vue-asyncable": "^0.2.0",
"vue-jest": "^3.0.4",
"vue-template-compiler": "^2.5.22",
"vuedl": "^0.3.7",
"vuedl": "^0.3.8",
"vuetify": "^2.2.4"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DialogCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
title: String,
flat: Boolean,
innerScroll: Boolean,
titleClass: String,
titleClass: [String, Object],
actions: [Array, Object, Function],
handle: Function
},
Expand Down
30 changes: 16 additions & 14 deletions src/components/Prompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
:title="title"
:actions="actions"
:handle="handleClick"
:title-class="titleClass"
ref="card"
>
<v-form ref="form">
<v-text-field
ref="input"
v-model="editedValue"
:rules="rules"
:label="text"
v-bind="textField"
@keypress.enter="$emit('submit', editedValue)"
/>
</v-form>
<v-text-field
ref="input"
v-model="editedValue"
:rules="rules"
:label="text"
v-bind="textField"
@keyup.enter.stop="onEnter"
/>
</DialogCard>
</div>
</template>
Expand All @@ -24,20 +23,20 @@
import Confirmable from 'vuedl/src/mixins/confirmable'
import DialogCard from './DialogCard.vue'
import { VTextField, VForm } from 'vuetify/lib'
import { VTextField } from 'vuetify/lib'
export default {
components: {
DialogCard,
VTextField,
VForm
VTextField
},
layout: 'default',
mixins: [Confirmable],
props: {
value: String,
rules: Array,
textField: Object,
titleClass: [String, Object],
autofocus: {
type: Boolean,
default: true
Expand All @@ -56,11 +55,14 @@ export default {
}
},
methods: {
onEnter () {
this.$refs.card.$refs.actions.trigger(true)
},
handleClick (res, action) {
if (!action.key) {
this.$emit('submit', action.key)
}
const valid = this.rules ? this.$refs.form.validate() : true
const valid = this.rules ? this.$refs.input.validate() : true
if (!valid) {
this.$refs.input.focus()
return false
Expand Down

0 comments on commit 4655cf4

Please sign in to comment.