Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

'clicked' Event not working #24

Open
agriguol opened this issue Mar 1, 2017 · 19 comments
Open

'clicked' Event not working #24

agriguol opened this issue Mar 1, 2017 · 19 comments
Labels

Comments

@agriguol
Copy link

agriguol commented Mar 1, 2017

Hello! I am working electron-notifications but 'clicked' and 'swipeRight' not working.

notification.on('clicked', () => {
console.log("Clicked");
notification.close();
})

@Nantris
Copy link

Nantris commented Mar 1, 2017

From the documentation:

notification.on('buttonClicked', (text) => {
  if (text === 'Snooze') {
    // Snooze!
  }
  notification.close()
})

Note the use of 'buttonClicked' as opposed to 'clicked' you are using. Does that resolve it?

swipeRight should be swipedRight (with a 'd')

@cgerikj
Copy link
Contributor

cgerikj commented Mar 2, 2017

I've had the same problem on windows 7, 'clicked' doesn't seem to work but 'buttonClicked' does.

@agriguol
Copy link
Author

agriguol commented Mar 2, 2017

The event buttonClicked works, but 'clicked' does not work. I need to make click in the notification without buttons.

@bayleedev
Copy link
Owner

@agriguol if you run the playbook does the click example work?

@agriguol
Copy link
Author

agriguol commented Mar 2, 2017

@blainesch - 'clicked' event does not work with playbook.

You must to correct the 'swipedEvent' event (with a 'd') in the playbook.

@bayleedev
Copy link
Owner

@agriguol fixed with 78955ab

Can you give me some details to help me reproduce this?

  • Operating system
  • node version
  • any errors in the console you are getting

@agriguol
Copy link
Author

agriguol commented Mar 2, 2017

Operating system : Windows 10 Home Version 1511
node version: v6.9.5
npm version: 3.10.10
any errors in the console you are getting : no errors

@bayleedev
Copy link
Owner

I think I have reproduced this on a VM, but I'm having issues getting devtools open on the notification. I'll play around with this later tonight. Thanks for reporting it!

@bayleedev bayleedev added the bug label Mar 2, 2017
@Nantris
Copy link

Nantris commented Mar 5, 2017

I am able to consistently get devTools with

Updating windowOptions to:

let windowOptions = {
      width: 400,
      height: this.notificationHeight + verticalSpace,
      x: size.width - 400,
      y: 0,  /* this is because we set the poper position when we pop it from the queue */
      frame: true,
      resizable: true,
      alwaysOnTop: true,
      skipTaskbar: true,
      webPreferences: {
        devTools: true,
      },
      focusable: true,
    };

and adding

notificationWindow.openDevTools(); after notificationWindow.loadURL()

Not sure if you're having a general problem with devTools or just a specific one in that case. Hope this helps.

@afriedma
Copy link

I can re-produce it with palybook on windows 7

@afriedma
Copy link

Any plans on merging this fix?

@bayleedev
Copy link
Owner

@afriedma I have not found a way to fix this yet.

@Nantris
Copy link

Nantris commented Mar 19, 2017

I'm not clear on the issue here. Is it that we want to add a 'clicked' listener to the entire notification?

@afriedma
Copy link

Yes, it used to work fine. Any clues, I can help out if you needed.

@bayleedev
Copy link
Owner

@afriedma it's odd it would just stop, the behavior file hasn't been modified since it was created. The only thing that's changed recently was some css :/

@afriedma
Copy link

afriedma commented Mar 19, 2017 via email

@Nantris
Copy link

Nantris commented Mar 19, 2017

What element was the clicked listener attached to? Is it possible that another element is overlayed on top of the one you are trying to listen for clicks on?

For example, I noticed that the title has a ::before element which covers it, which was preventing me from listening for clicks on that element.

@bayleedev
Copy link
Owner

On my VM I looked at every major version with a playbook (v0.1.0 and higher) and none of them appear to work on Windows with the click event, so this isn't a regression.

@afriedma
Copy link

I just did some testing too, @blainesch you are correct, click event doesn't work on windows.

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

No branches or pull requests

5 participants