@lightningtv/core
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,2 +0,2 @@ | ||
import { ElementNode } from './elementNode.js'; | ||
import { isElementNode } from './utils.js'; | ||
/** | ||
@@ -14,5 +14,6 @@ * Children class | ||
for (let i = selectedIndex; i < this.length; i++) { | ||
if (this[i] instanceof ElementNode) { | ||
const element = this[i]; | ||
if (isElementNode(element)) { | ||
this._parent.selected = i; | ||
return this[i]; | ||
return element; | ||
} | ||
@@ -19,0 +20,0 @@ } |
@@ -185,10 +185,7 @@ import { renderer, createShader } from './lightningInit.js'; | ||
setFocus() { | ||
if (this.skipFocus) { | ||
return; | ||
} | ||
if (this.rendered) { | ||
// can be 0 | ||
if (this.skipFocus) { | ||
const index = this.parent?.children.indexOf(this); | ||
const nextChild = this.parent?.children[index + 1]; | ||
isElementNode(nextChild) && nextChild.setFocus(); | ||
return; | ||
} | ||
if (this.forwardFocus !== undefined) { | ||
@@ -195,0 +192,0 @@ if (isFunc(this.forwardFocus)) { |
{ | ||
"name": "@lightningtv/core", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Lightning TV Core for Universal Renderers", | ||
@@ -5,0 +5,0 @@ "type": "module", |
import { ElementNode, type ElementText } from './elementNode.js'; | ||
import { isElementNode } from './utils.js'; | ||
@@ -18,5 +19,6 @@ /** | ||
for (let i = selectedIndex; i < this.length; i++) { | ||
if (this[i] instanceof ElementNode) { | ||
const element = this[i]; | ||
if (isElementNode(element)) { | ||
this._parent.selected = i; | ||
return this[i] as ElementNode; | ||
return element; | ||
} | ||
@@ -23,0 +25,0 @@ } |
@@ -321,11 +321,8 @@ import { renderer, createShader } from './lightningInit.js'; | ||
setFocus() { | ||
if (this.skipFocus) { | ||
return; | ||
} | ||
if (this.rendered) { | ||
// can be 0 | ||
if (this.skipFocus) { | ||
const index = this.parent?.children.indexOf(this); | ||
const nextChild = this.parent?.children[index! + 1]; | ||
isElementNode(nextChild) && nextChild.setFocus(); | ||
return; | ||
} | ||
if (this.forwardFocus !== undefined) { | ||
@@ -423,3 +420,3 @@ if (isFunc(this.forwardFocus)) { | ||
for (let i = 0; i < this.children.length; i++) { | ||
const child = this.children[i] as ElementNode; | ||
const child = this.children[i]; | ||
if (isElementNode(child)) { | ||
@@ -426,0 +423,0 @@ if (child.id === id) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
162017
2415