gwt-material-table icon indicating copy to clipboard operation
gwt-material-table copied to clipboard

addRowShortPressHandler "bouncing"

Open simerlec opened this issue 7 years ago • 6 comments

Hello,

I have a table on which I added a ShortPressHandler via the addRowShortPressHandler(...) method. The event works fine but apparently fires multiple times within milliseconds, which results in unexpected behaviour. In my case I open a modal on click of a row and these multiple fires result in multiple lean overlays added by the modal.

Can anyone confirm this or is my implementation faulty?

kr

simerlec avatar Jul 17 '17 11:07 simerlec

Try increasing the longPressDuration (which the shortPress bases itself off) to see if this helps the issue.

table.setLongPressDuration(1000);

I believe the default is 500ms.

BenDol avatar Jul 28 '17 02:07 BenDol

Doesn't seem to help in this case.

simerlec avatar Jul 31 '17 07:07 simerlec

Were you able progress this at all? Will take a look, but if you have any more info it will help.

BenDol avatar Sep 24 '17 11:09 BenDol

Sry, I forgot about this ticket.

I could fix this issue by preventing the event propagation using

shortPressEvent.getEvent().stopImmediatePropagation();

simerlec avatar Sep 25 '17 11:09 simerlec

Okay, were you registering a LongPressHandler to the table at all?

BenDol avatar Sep 25 '17 13:09 BenDol

No, I just added a ShortPressHandler.

simerlec avatar Sep 25 '17 14:09 simerlec