Letrec. index in stdlib. fixing NaNs when measuring things without gaps, w or h. more window management stuff in OS
This commit is contained in:
parent
db4abfa450
commit
5f592f40bf
5 changed files with 89 additions and 15 deletions
|
|
@ -24,6 +24,7 @@ export function runAppCompiled(canvas: HTMLCanvasElement, store: any) {
|
|||
|
||||
function setFocus(componentKey: string | null) {
|
||||
if (focusedComponentKey === componentKey) return;
|
||||
|
||||
const oldFocus = focusedComponentKey;
|
||||
focusedComponentKey = componentKey;
|
||||
|
||||
|
|
@ -36,6 +37,15 @@ export function runAppCompiled(canvas: HTMLCanvasElement, store: any) {
|
|||
if (componentKey && componentInstances.has(componentKey)) {
|
||||
handleComponentEvent(componentKey, { _tag: 'Focused' });
|
||||
}
|
||||
|
||||
// Notify ancestors
|
||||
if (componentKey) {
|
||||
for (const key of componentInstances.keys()) {
|
||||
if (key !== componentKey && componentKey.startsWith(key + '.')) {
|
||||
handleComponentEvent(key, { _tag: 'ChildFocused' });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleComponentEvent(componentKey: string, event: any) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue