Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get click event to register at all in desktop app... works in the browser #27

Open
dascoder opened this issue Feb 21, 2019 · 2 comments

Comments

@dascoder
Copy link

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?

@csepulv
Copy link
Owner

csepulv commented Feb 22, 2019

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.

@dascoder
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants