fix: clear selected_field if field is removed

This commit is contained in:
Shariq Ansari 2023-01-02 21:34:29 +05:30
parent 6587d4b16e
commit 4ba05b8ac3
3 changed files with 6 additions and 3 deletions

View file

@ -56,6 +56,7 @@ function remove_column() {
// remove column
columns.splice(index, 1);
store.selected_field = null;
}
function move_columns_to_section() {
@ -104,7 +105,7 @@ function move_columns_to_section() {
<button
class="btn btn-xs btn-icon"
:title="__('Remove Column')"
@click="remove_column"
@click.stop="remove_column"
>
<div v-html="frappe.utils.icon('remove', 'sm')"></div>
</button>

View file

@ -19,6 +19,7 @@ function remove_field() {
}
let index = props.column.fields.indexOf(props.field);
props.column.fields.splice(index, 1);
store.selected_field = null;
}
function move_fields_to_column() {
@ -75,7 +76,7 @@ function move_fields_to_column() {
>
<div v-html="frappe.utils.icon('move', 'sm')"></div>
</button>
<button class="btn btn-xs btn-icon" @click="remove_field">
<button class="btn btn-xs btn-icon" @click.stop="remove_field">
<div v-html="frappe.utils.icon('remove', 'sm')"></div>
</button>
</div>

View file

@ -50,6 +50,7 @@ function remove_section() {
// remove section
sections.splice(index, 1);
store.selected_field = null;
}
function select_section() {
@ -122,7 +123,7 @@ function move_sections_to_tab() {
<button
class="btn btn-xs btn-section"
:title="__('Remove section')"
@click="remove_section"
@click.stop="remove_section"
>
<div v-html="frappe.utils.icon('remove', 'sm')"></div>
</button>