mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-18 00:32:06 +00:00
containerClildListOnChange optimised
This commit is contained in:
parent
4cb7c20b12
commit
a06423f0ec
1 changed files with 1 additions and 10 deletions
|
|
@ -29,16 +29,7 @@ class FocusableProvider extends Component {
|
|||
}
|
||||
|
||||
containerClildListOnChange = () => {
|
||||
for (let i = this.childElementRef.current.parentElement.children.length - 1; i >= 0; i--) {
|
||||
const child = this.childElementRef.current.parentElement.children[i];
|
||||
const tagName = child.tagName.toLowerCase();
|
||||
if (tagName !== 'script' && tagName !== 'style') {
|
||||
this.setState({
|
||||
focusable: this.childElementRef.current === child
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.setState({ focusable: this.childElementRef.current.nextElementSibling === null });
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue