replaceChildren is too recent
This commit is contained in:
parent
9dcf222c87
commit
b6efe967ea
16
sudoku.js
16
sudoku.js
@ -57,7 +57,7 @@ function searchCandidatesOf(box) {
|
|||||||
|
|
||||||
function showCandidatesOn(box) {
|
function showCandidatesOn(box) {
|
||||||
if (!box.disabled) {
|
if (!box.disabled) {
|
||||||
box.list.replaceChildren()
|
while (box.list.firstChild) box.list.firstChild.remove()
|
||||||
if (!box.value && box.candidates.size) {
|
if (!box.value && box.candidates.size) {
|
||||||
const candidatesArray = Array.from(box.candidates).sort()
|
const candidatesArray = Array.from(box.candidates).sort()
|
||||||
candidatesArray.forEach(candidate => {
|
candidatesArray.forEach(candidate => {
|
||||||
@ -70,8 +70,8 @@ function showCandidatesOn(box) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onfocus() {
|
function onfocus() {
|
||||||
this.previousValue = this.value
|
this.previousValue = this.value
|
||||||
this.select()
|
this.select()
|
||||||
}
|
}
|
||||||
|
|
||||||
function oninput() {
|
function oninput() {
|
||||||
@ -81,11 +81,11 @@ function oninput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function undo() {
|
function undo() {
|
||||||
if (history.length) {
|
if (history.length) {
|
||||||
previousState = history.pop()
|
previousState = history.pop()
|
||||||
previousState.input.value = previousState.value
|
previousState.input.value = previousState.value
|
||||||
refresh(previousState.input)
|
refresh(previousState.input)
|
||||||
if (history.length < 1) undoButton.disabled = true
|
if (history.length < 1) undoButton.disabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user