question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i remove selected by clicking the outside area of Selecto?

See original GitHub issue

Environments

  • Framework name: React Hooks
  • Framework version:
  • Component name:
  • Component version:
  • Testable Address(optional):

Description

Hello again @daybrush , Thank you so mush for great plugin. I’m using react-moveable with selecto as [https://daybrush.com/selecto/storybook/?path=/story/selecto-with-moveable--select-moveable-targets-in-real-time].

In your example, selection is unselect by clicking within this ".selecto-area .elements" div. I would like to remove selection by clicking outside area of Selecto. I tried with two option, First option with setTargets([]) to remove selection and it was remove the selection but i can’t select items again. Second option is i add ".selecto-area .elements" class to body tag. But other click event doesn’t work inside that body.

Do you have any example like that please?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
iBasitcommented, Mar 29, 2022

doesn’t work as expected. This issue should be reopen.

3reactions
daybrushcommented, Jun 24, 2020

@Eiputoo

In this code:

selectoRef.current.setSelectedTargets([]);
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I close a dropdown on click outside? - Stack Overflow
You can use (document:click) event: @Component({ host: { '(document:click)': 'onClick($event)', }, }) class SomeComponent() { constructor(private _eref: ...
Read more >
How to remove 'selected' class of row when clicking outside of ...
Hello, So I'm trying to remove the 'selected' class when clicking outside of the table (i.e..
Read more >
Make selections in Photoshop Elements - Adobe Support
To remove an area from the selection, click the Subtract From Selection button in the options bar, and click or click-drag across the...
Read more >
Move and resize controls independently - Microsoft Support
Right-click one of the selected controls, point to Layout, and then click Remove Layout. Access removes the selected controls from the layout. Top...
Read more >
PhpStorm - Multiple cursors and selection ranges - JetBrains
Alt+Click at one of the multiple carets to remove it. The last caret will not be removed. Add carets above or below the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found