-
Notifications
You must be signed in to change notification settings - Fork 64
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
Docs: how to use paper-button as a link #35
Comments
+1 |
1 similar comment
+1 |
Here's one way:
|
Or use the |
👍 AKA +1 |
With the @ebidel way, we need to write a javascript function... <paper-button onclick="addNewFeature(this)"></paper-button> function addNewFeature(el) {
// Wait for ripple to finish.
el.addEventListener('transitionend', function(e) {
location.href = '/admin/features/new';
});
} And if we use a declarative <a href="https://www.polymer-project.org">
<paper-button>Polymer website</paper-button>
</a> We can have something like this? <paper-button href="https://www.polymer-project.org">Polymer website</paper-button> |
I don't think href makes sense on paper-button, but it would be nice if paper-button knew it had a anchor children and had a feature that de-janked the ripple for you. |
@ebidel like this? <paper-button>
<a href="https://www.polymer-project.org">Polymer website</a>
</paper-button> |
Yes. It would JustWork:registered: |
@ebidel and we have the same problem with the <paper-icon-button icon="polymer">
<a href="https://www.polymer-project.org"></a>
</paper-icon-button> |
@robdodson @ebidel do you have any news about this? We have the same "problem" with the |
/sub |
After thinking about this for a bit, I believe the ideal we should strive for is this form: <a href="https://www.polymer-project.org">
<paper-button>Polymer website</paper-button>
</a> However, there may be problems with this form (e.g., a parent expects a specific kind of child, so wrapping is not an option). Are there any known conditions that you guys have run into where this would not work?
I tested this and the ripple seems to work fine in this condition. |
That looks fine to me. I would maybe put noink on the button to get rid of
|
Thanks @cdata! I can you show an use of case when we have problems: http://jsbin.com/kuyisinara The solution would be to add the |
Added an example of this in #91. I decided to leave out the |
@keanulee check the behavior with focus. :/ |
Nice @keanulee! Your welcome! |
Example has been added in #91 |
@keanulee It would be great if you add another example waiting to finish the ripple effect before opening the link. 😊 |
Element doc should include an example of wrapping the button in an anchor so it can be used as a link.
The text was updated successfully, but these errors were encountered: