Skip to content

Commit

Permalink
Merge pull request #6009 from getkirby/fix/6008-slug-field-wizard
Browse files Browse the repository at this point in the history
Slug field: fix wizard button
  • Loading branch information
bastianallgeier authored Nov 30, 2023
2 parents 31ac829 + 6aa58d7 commit 3c7aa6e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions panel/src/components/Forms/Field/SlugField.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<template>
<k-field v-bind="$props" :input="_uid" :help="preview" class="k-slug-field">
<template v-if="wizard && wizard.text" #options>
<k-button :text="wizard.text" icon="sparkling" @click="onWizard" />
<k-button
:text="wizard.text"
icon="sparkling"
size="xs"
variant="filled"
@click="onWizard"
/>
</template>

<k-input
Expand Down Expand Up @@ -68,8 +74,14 @@ export default {
this.$refs.input.focus();
},
onWizard() {
if (this.formData[this.wizard?.field]) {
this.slug = this.formData[this.wizard.field];
let field = this.wizard?.field;
if (field) {
const value = this.formData[field.toLowerCase()];
if (value) {
this.slug = value;
}
}
}
}
Expand Down

0 comments on commit 3c7aa6e

Please sign in to comment.