question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mdc-simple-menu firing "cancel" event when setting "open"?

See original GitHub issue

What MDC-Web Version are you using?

`0.5.0

What browser(s) is this bug affecting?

Firefox 52.0, Chrome

What OS are you using?

Linux w/ kernel 4.9.11-1

What are the steps to reproduce the bug?

  1. Click on the button that says “click me”.
  2. Click on the button again. Notice in the console that the “cancel” event will continue to fire, but the menu will be hidden.

This isn’t exactly what’s happening to be but it’s related.

http://codepen.io/anon/pen/QpGOMp

What is the expected behavior?

Ideally clicking the button again wouldn’t do anything, but the switch should toggle (and it does).

What is the actual behavior?

Clicking on the button again closes the menu, and then prevents it from being open again; each subsequent click will fire the “close” event.

Any other information you believe would be useful?

Here’s why this is a problem for me:

screenshot

screenshot

After toggling, clicking the “settings” button again does nothing, but the “cancel” event continues to fire.

screenshot

I’m not entirely sure if I’m doing this right. I’ll try creating a component using the foundation class rather than using the menu-simple built in object and report back.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kminehartcommented, Mar 9, 2017

Sounds easy enough; I can give it a shot.

0reactions
kfranqueirocommented, Dec 5, 2018

This is most likely obsolete since the Menu component has since been refactored. Feel free to comment if this is still reproducible with current MDCMenu.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTMLDialogElement: cancel event - Web APIs | MDN
The cancel event fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog.
Read more >
vb.net - ContextMenuStrip.Opening event Handler fires with e.cancel ...
I found my problem: I'm populating the ContextMenuStrip within the Opening event, so the first time it is called it is empty and...
Read more >
Cancel a meeting - Microsoft Support
Double-click the meeting to open it. On the ribbon, click Cancel Meeting. The meeting form will change into a meeting cancellation form. Type...
Read more >
Cancel event - Stripe JS Reference
Setting up · The Elements object · The Element · Payment Intents · Setup Intents · The Payment Request object · Payment Methods...
Read more >
cancel - API Reference - Kendo UI Grid - Documentation
The widget instance which fired the event. Example - subscribe to the "cancel" event during initialization. Edit Preview Open ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found