Hello!
I have an annoying problem with LayoutClickListener.
If the user clicks the mouse too often, it is not possible to clear the buffer of events.
And if each click is processed long enough (more than 100 milliseconds), the whole process begins to slow down.
If this problem can not be solved in a general way, then perhaps someone can help me with a particular case.
At the click of the mouse, I hung Event calling a modal window.
If a user makes a few quick clicks, it opens a modal windows - one on another.
What better way to solve this problem?
Sounds quite a tricky problem. The client side can’t really know whether or not to send the event, so I guess the problem should be solved on the server.
What about buffering the click events yourself? Then purge the buffer whenever you feel it’s safe (e.g. once every 100ms), and clear all unwanted events.
I don’t quite get the use case. What is the user trying to do/achieve? Opening modal windows from consecutive mouse clicks sounds like a bad behavior, but since I know nothing about your case, I might be totally wrong.
Thanks for answer!
This gave me an understanding that there is no generally accepted solution. And this is more than enough.
I have all clicks are caught by a single handler.
So I think a fairly good solution would be to ignore events if since the last processed passed less NNN milliseconds.