Fix for field modal infinite render loop once closed from click away
This commit is contained in:
parent
494d93b46b
commit
70cc2273f2
|
@ -11,7 +11,7 @@ let listenerAdded = false;
|
||||||
$: {
|
$: {
|
||||||
if(ukModal && !listenerAdded) {
|
if(ukModal && !listenerAdded) {
|
||||||
listenerAdded = true;
|
listenerAdded = true;
|
||||||
ukModal.addEventListener("hide", onClosed);
|
ukModal.addEventListener("hidden", onClosed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ukModal) {
|
if(ukModal) {
|
||||||
|
|
|
@ -39,6 +39,7 @@ store.subscribe($store => {
|
||||||
editingField = true;
|
editingField = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onFinishedFieldEdit = (field) => {
|
onFinishedFieldEdit = (field) => {
|
||||||
if(field) {
|
if(field) {
|
||||||
store.saveField(field);
|
store.saveField(field);
|
||||||
|
@ -139,7 +140,7 @@ const nameChanged = ev => {
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if editingField}
|
{#if editingField}
|
||||||
<Modal bind:isOpen={editingField}>
|
<Modal bind:isOpen={editingField} onClosed={() => onFinishedFieldEdit(false) }>
|
||||||
<FieldView field={fieldToEdit}
|
<FieldView field={fieldToEdit}
|
||||||
onFinished={onFinishedFieldEdit}
|
onFinished={onFinishedFieldEdit}
|
||||||
allFields={record.fields}
|
allFields={record.fields}
|
||||||
|
|
Loading…
Reference in New Issue