Prevent creation of multiple regions #3601
Unanswered
ManimMadhav
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I wanted to ask if it's possible to prevent creation of multiple regions. My application works like this:
When a user creates a region by dragging using
enableDragSelection()
method, he clicks on it and then performs some action.However, if he doesn't click on it, I want the previous region to be removed (which wasn't clicked on) and retaining only the new region which he created by dragging again.
One approach that I have thought of is, to set a variable value to true/false, given that user creates a region using
region-created
event, but does not click on it (which can be found out usingregion-clicked
event). I want to ensure that a user clicks on a region after creating it, and if he does not click on it and attempts to create another region, the previous region gets removed.Hope that makes sense. Is there any way to do this?
Edit: Fixed a typo.
Beta Was this translation helpful? Give feedback.
All reactions