I'm trying to use the ripple effect on a clickable list of items but I'm facing the issue that the ripple effect goes all over the screen when I encapsulate that list into a custom element. It works great if I place it in my index.html but fails when I create a custom element that is included there. See an image of the issue:
I've been reading similar questions where the answer is to make the container relative, which should be already done. So I'm wondering if it is required to set any special attribute in the host when using the ripple effect from a custom element.
My example code is as follow.
Index.html
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>List test</title>
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="elements/elements.html">
<style>
paper-icon-item {
position: relative;
height: 48px;
}
</style>
</head>
<body unresolved class="fullbleed layout vertical">
<template is="dom-bind" id="app">
<my-list></my-list>
</template>
<script src="scripts/app.js"></script>
</body>
</html>
my-list.html
<dom-module id="my-list">
<style>
paper-icon-item {
position: relative;
height: 48px;
}
</style>
<template>
<section>
<div class="menu">
<paper-icon-item>
<div class="label" fit>Mark as unread</div>
<paper-ripple></paper-ripple>
</paper-icon-item>
<paper-icon-item>
<div class="label" fit>Mark as important</div>
<paper-ripple></paper-ripple>
</paper-icon-item>
<paper-icon-item>
<div class="label" fit>Add to Tasks</div>
<paper-ripple></paper-ripple>
</paper-icon-item>
<paper-icon-item>
<div class="label" fit>Create event</div>
<paper-ripple></paper-ripple>
</paper-icon-item>
</div>
</section>
</template>
</dom-module>
<script>
(function () {
Polymer({
is: 'my-list'
});
})();
</script>
When replacing the in the index.html by the section tag content (the section tag included) of my-list.html, the ripple effect works fine. The fit property in the ripple didn't solve the problem either. What am I missing in the custom component?