Skip to content

Commit

Permalink
added focus to cell
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmaranje committed May 10, 2024
1 parent 336ea3b commit 6145509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function selectCell(cell) {
}
const cellClass = new Cell(cell);
console.log(cellClass);

cell.focus()
return cell
}

Expand Down
10 changes: 6 additions & 4 deletions src/js/elements/Cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Siblings {
column;

/**
* @type {HTMLCollection}
* @type {Element[]}
*/
row

Expand All @@ -46,7 +46,9 @@ class Siblings {
}

colSiblings(parent, index) {
return this.findColSiblings(parent, index).reverse().concat(this.findColSiblings(parent, index, false))
return this.findColSiblings(parent, index)
.reverse()
.concat(this.findColSiblings(parent, index, false))
}

rowSiblings(parent, index) {
Expand All @@ -56,7 +58,7 @@ class Siblings {
}

/**
* @param parent {ParentNode}
* @param parent {ChildNode}
* @param index {number}
* @param backwards {boolean}
*/
Expand All @@ -67,7 +69,7 @@ class Siblings {
/**
* @type {ChildNode[]}
*/
let colSiblings= [];
let colSiblings = [];

const columnSibling = parentSiblings.children[index];
colSiblings.push(columnSibling);
Expand Down

0 comments on commit 6145509

Please sign in to comment.