Commit aea1d766 authored by graciano codes's avatar graciano codes

FINALLY fixes the spacebar scroll down bug

parent f7129808
......@@ -23,10 +23,15 @@ const renderSheet = async fileData => {
const spacebarToggle = player => document.addEventListener('keyup', ev => {
// space bar
if (ev.keyCode === 32) {
ev.preventDefault()
player.toggle()
}
return false
})
const preventSpacebarScroll = () => document.addEventListener('keydown', ev => {
// space bar
if (ev.keyCode === 32) {
ev.preventDefault()
return false
}
})
const toggleButton = player => document.querySelector('#play-button')
......@@ -37,6 +42,7 @@ const stopButton = player => document.querySelector('#stop-button')
ipcRenderer.on('read-file-reply', async (event, { fileData }) => {
try {
const player = await renderSheet(fileData)
preventSpacebarScroll()
spacebarToggle(player)
toggleButton(player)
stopButton(player)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment