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

Drag select libaray 2.3.1 not capturing multiple items with angular 9 version #134

Closed
gauravdhmj opened this issue Jul 27, 2022 · 2 comments

Comments

@gauravdhmj
Copy link

gauravdhmj commented Jul 27, 2022

Drag select libaray 2.3.1 not capturing multiple items with angular 9 version
Describe the bug
When user drag mouse on multiple words, It does not capture any word.

Expected behavior
Program should return the selected words on the browser.

Code Example
We are using below code in our application to create a drag select library object.

this.ds = new DragSelect({
selector: document.getElementById('rectangle'),
selectables: document.getElementsByTagName('rect') as unknown as SVGElement[],
//multiSelectKeys: ['ctrlKey', 'shiftKey'],
area: document.getElementById('images'),
draggability: false
});
this.ds.start();

and

We are trying to retrieve selected element using below code.
let element = this.ds.getSelection();
element variable length is always zero while we select more than one word.However, it works fine with single selection

Screenshots
If applicable, add screenshots to help explain your problem.

In the screenshot, we have selected 2 words("AS PER") using mouse drag(they are visible with dotted rectangle) on chrome browser. However, Drag select library not able to capture selected words using "getSelection()" method because we have selected multiple words.

Error_DragSelect

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise and centOS
  • Browser: chrome
  • OS Build Version: 19044.1826

Additional context
Our Application is using angular 9.

@ThibaultJanBeyer
Copy link
Owner

Hi @gauravdhmj thanks for using the tool! ❤️‍🔥

I am trying to reproduce your issue, are you able to share a https://codepen.io/pen/ by any chance? You can use this one as a starting point. Theoretically, it should not be related to Angular. This would make it easier for me to reproduce.

Thank you!

@ThibaultJanBeyer
Copy link
Owner

Ideally would be nice to have a guide for Angular as mentioned here. Without a code example, unfortunately, I can’t help. I’ll close it for now and have a look into Angular. Please provide a code example and feel free to re-open if you have one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants