electron-notifications
electron-notifications copied to clipboard
'clicked' Event not working
Hello! I am working electron-notifications but 'clicked' and 'swipeRight' not working.
notification.on('clicked', () => { console.log("Clicked"); notification.close(); })
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')
I've had the same problem on windows 7, 'clicked' doesn't seem to work but 'buttonClicked' does.
The event buttonClicked works, but 'clicked' does not work. I need to make click in the notification without buttons.
@agriguol if you run the playbook does the click example work?
@blainesch - 'clicked' event does not work with playbook.
You must to correct the 'swipedEvent' event (with a 'd') in the playbook.
@agriguol fixed with 78955ab868989529731bdfc45d4075450fe9f2ce
Can you give me some details to help me reproduce this?
- Operating system
- node version
- any errors in the console you are getting
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
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!
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.
I can re-produce it with palybook on windows 7
Any plans on merging this fix?
@afriedma I have not found a way to fix this yet.
I'm not clear on the issue here. Is it that we want to add a 'clicked'
listener to the entire notification?
Yes, it used to work fine. Any clues, I can help out if you needed.
@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 :/
May be because you made the browser window same size as HTML div? Click is not being propogated?
Cheers, Alex
From: Blaine Schmeisser [email protected] Sent: Sunday, March 19, 2017 3:10:21 PM To: blainesch/electron-notifications Cc: afriedma; Mention Subject: Re: [blainesch/electron-notifications] 'clicked' Event not working (#24)
@afriedmahttps://github.com/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 :/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/blainesch/electron-notifications/issues/24#issuecomment-287639272, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AV7wm32vQHnZ1WWOLDubwY6U3k35UK69ks5rnX2dgaJpZM4MQNiV.
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.
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.
I just did some testing too, @blainesch you are correct, click event doesn't work on windows.