Open dascoder opened 5 years ago
I don't know. If I add this to App.js, I see the messages in the console.
<button onClick={()=>{console.log("Button Pressed")}}>
Push me
</button>
I would start with simple buttons. There may be an issue with material-ui, but that unfortunately might mean debugging that side of things.
Interesting. I've removed material and tried the same experiment.
in the component constructor
this.toggleWindowVisibility = this.toggleWindowVisibility.bind(this)
the function
toggleWindowVisibility(){
if (document.visibilityState === "visible")
{
log.info("Clicked minimize!")
window.dispatchEvent(new Event('minimize'))
return
}
log.info("Window is not visible")
window.moveTo(0,0);
}
In the render function
<button onClick={this.toggleWindowVisibility}}> Push me </button>
still no event triggered.
Running Electron + react set up according to your guide here. I added a simple app bar from material and created a react class from the component.
However the components in the window launched by electron.exe are not responsive. If I go to localhost:3000 then I find that the buttons are responsive and trigger events, everything works!
Any tips to help me investigate?