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.

Emit events for open/close drawer actions

See original GitHub issue

I noticed that the event pattern is implemented in MDCComponent. Is there a plan for components to emit events?

For example, MDCTemporaryDrawer could emit an open/close event - this would allow quick integrations without implementing the foundation adapters, and wiring up event handlers is certainly easier.

I was implementing mdc bindings for Knockout - and I have to subclass the MDCTemporaryDrawerFoundation just to get access to open/close in a non-hackish way.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
traviskaufmancommented, Mar 2, 2017

To be clear, the work I believe needs to be done here includes:

  • Adding a notifyOpen() => void method to the drawer’s adapter API, which is called when a drawer is open
  • Adding a notifyClose() => void method to the drawer’s adapter API, which is called when a drawer is closed. Note that this may need to take touch dragging into account.
  • Have the component broadcast a MDCTemporaryDrawer:open event as its notifyOpen() adapter implementation
  • Have the component broadcast a MDCTemporaryDrawer:close event as its notifyClose() adapter implementation
0reactions
anton-kachurincommented, Apr 18, 2017

@traviskaufman Sorry about this. I was really busy recently. I’ll start it today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DrawerActions reference - React Navigation
DrawerActions is an object containing methods for generating actions specific to drawer-based ... The openDrawer action can be used to open the drawer...
Read more >
v-navigation-drawer API - Vuetify
name type default #absolute boolean false #app boolean false #bottom boolean false
Read more >
Learn Angular Component Design Patterns - inDepth.dev
Dynamically update the left CSS property to open/close the drawer. ... takes a couple of inputs and emits the drawerClosed() event.
Read more >
Navigation drawer - Material Design
The navigation region holds navigational components and elements. It helps users navigate between destinations and initiate key actions. Margins greater than ...
Read more >
Vuex state vs event - Vue Forum
The better news is you can now open/close this drawer from anywhere because you can access your vuex actions from anywhere. Here's a...
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