Skip to content

Commit

Permalink
Fix newly discovered preset page bug
Browse files Browse the repository at this point in the history
- Keyboard was active on presets page
- Would reactivate upon focusout of inputs
- Fixed
  • Loading branch information
Mangoshi committed May 5, 2023
1 parent 0185b43 commit 6b31e2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/synth.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@ function togglePresetsPage() {
presetsContainer.classList.remove("hidden")
// change topRowContainer border styling
topRowContainer.classList.add("rounded-br-none", "rounded-bl-none")
// disable keyboard
SYNTH.STATE.physicalKeyboardActive = false
} else {
// show synthBody and p5_canvas
synthBody.classList.remove("hidden")
Expand All @@ -1126,6 +1128,8 @@ function togglePresetsPage() {
presetsContainer.classList.add("hidden")
// undo topRowContainer border styling
topRowContainer.classList.remove("rounded-br-none", "rounded-bl-none")
// enable keyboard
SYNTH.STATE.physicalKeyboardActive = true
}
SYNTH.STATE.presetsPageOpen = !SYNTH.STATE.presetsPageOpen
}
Expand Down Expand Up @@ -2036,7 +2040,9 @@ for(let input of inputs) {
})
input.addEventListener("focusout", e => {
console.log(e)
SYNTH.STATE.physicalKeyboardActive = true
if(!SYNTH.STATE.presetsPageOpen){
SYNTH.STATE.physicalKeyboardActive = true
}
})
}

Expand Down

0 comments on commit 6b31e2b

Please sign in to comment.