Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unselect selected elements on blur #228

Open
Keshav-Madhav opened this issue Apr 29, 2024 · 2 comments
Open

Unselect selected elements on blur #228

Keshav-Madhav opened this issue Apr 29, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Keshav-Madhav
Copy link

What is the problem?
After selecting desired elements, clicking outside any selectables but inside the selection area should un-select the selected elements.

What is the current behavior?
Clicking outside the selectables but still inside the selection area does not clear the selection. Clicking on a selectable when multiple elements are selected correctly clears the selection and selects the new selectable.

What is the expected behavior?
Clicking anywhere inside the selection area should clear the selected items unless the shift or ctrl key is pressed.

@Keshav-Madhav
Copy link
Author

I just tried to further experiment with it, and in the selectionarea wrapper provided, onStart only triggers when an selectable area is clicked or drag is started. This makes it such that if i drag an empty area, the selected files get unselected as desired, but i want the same behavior for a simple click.

The selectionarea also does not respond to event listeners such as onClick or onMouseDown so i could not add the desired effect on my own.

@simonwep
Copy link
Owner

The selectionarea also does not respond to event listeners such as onClick or onMouseDown so i could not add the desired effect on my own.

You can just add a listener to the selection-area by yourself and clear the selection if there hasn't been a selection between the pointerdown and pointerup events, or something like this :)

@simonwep simonwep added the question Further information is requested label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants