Skip to content

feature: workflow for de-duplicating mouse events when within a given zone #10

@lrstanley

Description

@lrstanley

✨ Describe the feature you'd like

A way with BubbleZone to reduce the chance of duplicated clicks being sent.

🌧 Is your feature request related to a problem?

Today, when holding one of the mouse buttons (and dragging), BubbleTea emits multiple events for each cell that the mouse has dragged over. The common way that I think most people use BubbleZone, where it's a simple bounds check, will be subject to situations where a user might intend on clicking something, then causing a drag during the clicking process (this isn't an issue unless they drag over a column/row boundary).


Not sure what the best approach to address this issue. Ideally, if we could capture a mouseup event, that is specific to left or right, I think that would be the ideal situation, rather than mousedown. A mousedown event can be triggered multiple times due to dragging, whereas I don't think mouseup would.

Today, I believe mouseup isn't specific to left/right.

Below screenshot shows an example of drag causing multiple events:


Maybe if the developer does an action based on a zone + mouse event, we have some way of caching that? And if we receive a mouseup event, we clear that cache? This would mean that unless we receive a mouseup event, we could have a way of checking if we've already done an action from mousedown for that zone?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions