|
|
|
|
@ -43,9 +43,8 @@ export function runAppCompiled(app: App, canvas: HTMLCanvasElement, rt: any) {
|
|
|
|
|
|
|
|
|
|
// Focus event to the new
|
|
|
|
|
if (componentKey && componentInstances.has(componentKey)) {
|
|
|
|
|
handleComponentEvent(componentKey, { name: 'Focused' });
|
|
|
|
|
handleComponentEvent(componentKey, { _tag: 'Focused' });
|
|
|
|
|
}
|
|
|
|
|
rerender();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleComponentEvent(componentKey: string, event: any) {
|
|
|
|
|
@ -89,7 +88,7 @@ export function runAppCompiled(app: App, canvas: HTMLCanvasElement, rt: any) {
|
|
|
|
|
instance.view = ui.view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ui.autoFocus && isNew) {
|
|
|
|
|
if (ui.autoFocus?._tag === 'True' && isNew) {
|
|
|
|
|
setFocus(fullKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -144,6 +143,13 @@ export function runAppCompiled(app: App, canvas: HTMLCanvasElement, rt: any) {
|
|
|
|
|
const ui = valueToUI(uiValue);
|
|
|
|
|
const expandedUI = expandStateful(ui, [], renderedKeys);
|
|
|
|
|
|
|
|
|
|
// clean up unrendered instances
|
|
|
|
|
for (const key of componentInstances.keys()) {
|
|
|
|
|
if (!renderedKeys.has(key)) {
|
|
|
|
|
componentInstances.delete(key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (focusedComponentKey && !renderedKeys.has(focusedComponentKey)) {
|
|
|
|
|
focusedComponentKey = null;
|
|
|
|
|
}
|
|
|
|
|
|