paper-ripple mouseDown event handler downAction Override
NickName:dman Ask DateTime:2015-10-11T10:07:58

paper-ripple mouseDown event handler downAction Override

Polymer 1.1

In paper ripple source code they have the mouseDown event handler:

  /** @param {Event=} event */
  downAction: function(event) {
    var xCenter = this.containerMetrics.width / 2;
    var yCenter = this.containerMetrics.height / 2;

In documentation it states:

paper-ripple listens to "mousedown" and "mouseup" events so it would display ripple effect when touches on it. You can also defeat the default behavior and manually route the down and up actions to the ripple element

However, in my custom element I am not able to override this handler:

        <paper-ripple
          fit
          id="ripple"
          initial-opacity="0.95"
          opacity-decay-velocity="0.98">
        </paper-ripple>
      </section>
    </template>
  </template>

  <script>
    Polymer({
      is: "portfolio-page",
     ...
      downAction: function(e) {
        console.log('sssssssssssssssssssssssss');
      },
      upAction: function(e) {
        this.$.ripple.upAction();
      }

When I induce the action of paper ripple by clicking on my element, I do not get any console output.

How do I override the default downAction handler for mouseDown that paper-ripple listens for as documented in paper-ripple doc?

Copyright Notice:Content Author:「dman」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/33060861/paper-ripple-mousedown-event-handler-downaction-override

More about “paper-ripple mouseDown event handler downAction Override” related questions

paper-ripple mouseDown event handler downAction Override

Polymer 1.1 In paper ripple source code they have the mouseDown event handler: /** @param {Event=} event */ downAction: function(event) { var xCenter = this.containerMetrics.width / 2; ...

Show Detail

Polymer paper-ripple programatically trigger downAction at given x,y coordinates

I am trying to trigger a ripple animation programatically at a given x,y coordinate, but I can't seem to get it right. I have found a few helpful answers like these: paper-ripple mouseDown event

Show Detail

Mousedown event handler interferes with key handlers

My application kept misbehaving. After removing more and more code I managed to find the core of the problem which however makes no sense to me. Bit of a background. My web editor application react...

Show Detail

Add event handler (MouseDown) dynamically for PathFigure C# WPF

I created an object from points with this code, dynamically: SolidColorBrush brushColor = (SolidColorBrush)new BrushConverter().ConvertFromString(_brushColor); PathFigure figures = new PathFigure...

Show Detail

mousedown event handler on table rows in different browsers

I want to be able to select a row from a table by registering a mousedown event on each row of a named table (see code). I'm testing in Firefox 14.0, Chrome 20.0.1132.47, and IE 8 (for testing). ...

Show Detail

Capture MouseDown event for .NET TextBox

Is there any way to capture the MouseDown even from the .NET 2.0 TextBox control? I know the inherited Control class has the event, but it's not exposed in TextBox. Is there a way to override the e...

Show Detail

Why MouseDown event handler is not getting hit?

I have this very simple button in a WPF that is supposed to call a function preview() on MouseDown, and function hide() on MouseUp. However it's not working and not even hitting its event handler....

Show Detail

Nullpointer error on event listeners when using StaticResource and MouseDown handler

I have a very odd error case that sprung up the moment I used a StaticResource converter on a Rectangle for coloring its background and at the same time using a MouseDown handler on another component

Show Detail

Polymer paper-ripple and on-mouseover

I am trying to implement my own custom tooltip element, which displays the tooltip when the on-mouseover event is fired. However, this does not work: &lt;div class="message&gt; &lt;custom-too...

Show Detail

How to trigger contenteditable mousedown event?

I have a somewhat odd setup wherein a table cell is made contenteditable=true with a div placed over it to add some border effects without changing the dimensions of any of the cells in the table. ...

Show Detail