@lightningjs/solid
Advanced tools
Comparing version 0.12.3 to 0.12.4
@@ -618,2 +618,12 @@ import { createSignal, mergeProps as mergeProps$1, createRoot, createRenderEffect, createMemo, createComponent as createComponent$1, untrack, onMount } from 'solid-js'; | ||
if (this.rendered) { | ||
if (this.forwardFocus !== undefined) { | ||
if (isFunc(this.forwardFocus)) { | ||
return this.forwardFocus.call(this); | ||
} | ||
const focusedIndex = typeof this.forwardFocus === 'number' ? this.forwardFocus : null; | ||
if (focusedIndex !== null && focusedIndex < this.children.length) { | ||
const child = this.children[focusedIndex]; | ||
child instanceof ElementNode && child.setFocus(); | ||
} | ||
} | ||
// Delay setting focus so children can render (useful for Row + Column) | ||
@@ -620,0 +630,0 @@ queueMicrotask(() => setActiveElement(this)); |
@@ -105,2 +105,3 @@ /* | ||
autofocus; | ||
forwardFocus; | ||
_undoStates; | ||
@@ -283,2 +284,12 @@ _renderProps; | ||
if (this.rendered) { | ||
if (this.forwardFocus !== undefined) { | ||
if (isFunc(this.forwardFocus)) { | ||
return this.forwardFocus.call(this); | ||
} | ||
const focusedIndex = typeof this.forwardFocus === 'number' ? this.forwardFocus : null; | ||
if (focusedIndex !== null && focusedIndex < this.children.length) { | ||
const child = this.children[focusedIndex]; | ||
child instanceof ElementNode && child.setFocus(); | ||
} | ||
} | ||
// Delay setting focus so children can render (useful for Row + Column) | ||
@@ -285,0 +296,0 @@ queueMicrotask(() => setActiveElement(this)); |
@@ -38,2 +38,3 @@ import { createShader } from '../renderer/index.js'; | ||
autofocus: boolean; | ||
forwardFocus?: number | ((this: ElementNode) => void); | ||
private _undoStates?; | ||
@@ -78,3 +79,3 @@ private _renderProps; | ||
start(): Promise<void>; | ||
setFocus(): void; | ||
setFocus(): any; | ||
isTextNode(): boolean; | ||
@@ -81,0 +82,0 @@ _resizeOnTextLoad(): void; |
@@ -23,2 +23,3 @@ import { type AnimationSettings, type Dimensions, type INode, type INodeWritableProps, type ITextNodeWritableProps, type NodeFailedPayload, type NodeLoadedPayload } from '@lightningjs/renderer'; | ||
onLayout?: (child: ElementNode, dimensions: Dimensions) => void; | ||
forwardFocus?: number | ((this: ElementNode) => void); | ||
ref?: ElementNode | ((node: ElementNode) => void) | undefined; | ||
@@ -25,0 +26,0 @@ selected?: number; |
{ | ||
"name": "@lightningjs/solid", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"description": "Lightning renderer for solid universal", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -163,2 +163,3 @@ /* | ||
autofocus: boolean; | ||
forwardFocus?: number | ((this: ElementNode) => void); | ||
@@ -370,2 +371,13 @@ private _undoStates?: Record<string, any>; | ||
if (this.rendered) { | ||
if (this.forwardFocus !== undefined) { | ||
if (isFunc(this.forwardFocus)) { | ||
return this.forwardFocus.call(this); | ||
} | ||
const focusedIndex = | ||
typeof this.forwardFocus === 'number' ? this.forwardFocus : null; | ||
if (focusedIndex !== null && focusedIndex < this.children.length) { | ||
const child = this.children[focusedIndex]; | ||
child instanceof ElementNode && child.setFocus(); | ||
} | ||
} | ||
// Delay setting focus so children can render (useful for Row + Column) | ||
@@ -372,0 +384,0 @@ queueMicrotask(() => setActiveElement<ElementNode>(this)); |
@@ -52,2 +52,3 @@ /* | ||
onLayout?: (child: ElementNode, dimensions: Dimensions) => void; | ||
forwardFocus?: number | ((this: ElementNode) => void); | ||
ref?: ElementNode | ((node: ElementNode) => void) | undefined; | ||
@@ -54,0 +55,0 @@ selected?: number; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
296313
4603