Skip to content

Expose mdRipple instance in MdButton components #6340

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

Closed
kherock opened this issue Aug 8, 2017 · 2 comments
Closed

Expose mdRipple instance in MdButton components #6340

kherock opened this issue Aug 8, 2017 · 2 comments

Comments

@kherock
Copy link
Contributor

kherock commented Aug 8, 2017

Bug, feature request, or proposal:

feature request: Developers should have a way to programmatically trigger md-button ripples.

What is the current behavior?

To the best of my knowledge, Angular doesn't provide any way to access directive instances on on descendants of components declared in a template. The closest I can get to accessing the ripple is by getting a reference to the MdButton instance.

What is the use-case or motivation for changing an existing behavior?

I'm making a carousel-type component that allows using the keyboard arrow keys to navigate. As a nice touch of visual feedback, I'd like to trigger a ripple on the buttons on keydown.

Here I've monkeypatched MdButton to demonstrate what I want:
https://embed.plnkr.co/esgkZ5ZtH9Vl8Wlkqx7t/

It's also useful if I want to implement a basic version of the feature discovery pattern:
https://material.io/guidelines/growth-communications/feature-discovery.html

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest

Is there anything else we should know?

It might be useful to expose this on other components that implement ripples. It should be as simple as adding a ViewChild and documenting its existence as a component property.

@kherock kherock changed the title Expose mdRipple instance in mdButton components Expose mdRipple instance in MdButton components Aug 8, 2017
@devversion
Copy link
Member

Thanks for the issue. We already have a similar issue: #4179

It would be great if you add your feedback/problem there as well!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants