forked from GitHub/virtualtabletop
fixed crash after renaming a widget (#2216)
This commit is contained in:
parent
b455f4cc53
commit
93a8713e6c
@ -35,7 +35,8 @@ class JsonModule extends SidebarModule {
|
||||
} else {
|
||||
jeEmpty();
|
||||
}
|
||||
$('#jeText').blur();
|
||||
if(!jeDeltaIsOurs)
|
||||
$('#jeText').blur();
|
||||
}
|
||||
|
||||
renderModule(target) {
|
||||
@ -70,7 +71,8 @@ class TreeModule extends SidebarModule {
|
||||
jeEmpty();
|
||||
jeCenterSelection();
|
||||
}
|
||||
$('#jeText').blur();
|
||||
if(!jeDeltaIsOurs)
|
||||
$('#jeText').blur();
|
||||
}
|
||||
|
||||
onStateReceivedWhileActive() {
|
||||
|
@ -1483,12 +1483,15 @@ async function jeApplyChanges() {
|
||||
|
||||
const currentState = JSON.stringify(jePostProcessObject(completeState));
|
||||
if(currentStateRaw != jeStateBeforeRaw || jeKeyIsDownDeltas.length) {
|
||||
const idChanged = JSON.parse(currentState).id != JSON.parse(jeStateBefore).id;
|
||||
jeDeltaIsOurs = true;
|
||||
await jeApplyExternalChanges(completeState);
|
||||
jeStateBeforeRaw = currentStateRaw;
|
||||
const oldState = jeStateBefore;
|
||||
jeStateBefore = currentState;
|
||||
await updateWidget(currentState, oldState); // in editmode.js
|
||||
if(idChanged)
|
||||
setSelection([ widgets.get(JSON.parse(currentState).id) ]);
|
||||
jeDeltaIsOurs = false;
|
||||
}
|
||||
}
|
||||
|
@ -150,11 +150,9 @@ test('Dynamic expressions', async t => {
|
||||
.click('#editButton')
|
||||
.click('#editorToolbar > div > [icon=add]')
|
||||
.click('#addBasicWidget')
|
||||
.click('#room',{offsetX: 1, offsetY: 1, modifiers:{ctrl:true}})
|
||||
.click(Selector('button').withAttribute('icon', 'data_object'))
|
||||
.typeText('#jeText', button, { replace: true, paste: true })
|
||||
.rightClick('#w_jyo6')
|
||||
.rightClick('#w_jyo6')
|
||||
.click(Selector('button').withAttribute('icon', 'pest_control'))
|
||||
const log = await Selector('#jeLog').textContent
|
||||
for (let i=0; i<ops.length; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user