Giter Site home page Giter Site logo

Comments (21)

toddhd avatar toddhd commented on May 22, 2024 2

That appears to have worked! Thank you!

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024 1

Thank you for the quick reply and investigation by the way, I can't believe you answered so quickly! :)

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Hey @toddhd, this is actually the expected behavior. The shift key is basically a "temporary add" so the items you select when holding down shift will only be selected when you release the mouse button. The same goes for Shift + CTRL for temporarily removing items. Same here, the items are only removed when you release the mouse button.

But, I am figuring that even when the mouse button is released the items are not selected. There is something off. Maybe I have broken something with the last fix or deployment. Does that work for you?

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

So I have tested this on Mac as well, and there it seems to work... I am investigating what the differences are.

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

What I expected was one of two situations. Either onSelect() would fire each time you lift your finger off the mouse button (as you described) or that it would fire once you released the SHIFT key (which is what I expected, as that would indicate that all of your selections are done). Either would work for my needs.

I am creating a schedule component that allows the user to drag across a "calendar" of sorts. Unfortunately, it does not work for me as I have no idea what is selected unless the event passes me the items. (For some reason, my "selectedItems" never seems to actually contain my selected items as it should, so I've been grabbing the selected items by hand from onSelect() and processing them from there.

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Hehe, I am definitely dedicated to fix incoming issues. And this seems to be a big one... I am wondering why this works on Mac but not on a Windows. Which OS are you using? It also doesn't seem to be related to the browser, cause Firefox on Mac works as expected... super strange.

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

I am working on Windows 10 Pro 64bit. Chrome is my main browser but I am testing in FireFox at the moment. Everything (OS, browsers) is up to date. Appreciate the help.

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Ok, good to know. Very interesting. This is really hard to reproduce and to verify for me on a Mac. Cause it works as expected... I also have a Windows but that's not my dev machine. There it's broken.

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

This is how it works on Mac, and this is also how it's supposed to be working.

selection_on_mac

Still trying to figure out how I can reproduce this on my dev machine...

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

Do you happen to have Firefox or Chrome on OSX? Does it work in those browsers in OSX?

What are you using for the selection capability? Are you using Angular's built-in select, or custom code? Maybe the problem is in their logic, if it is a third-party selection routine...

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

So I am mainly using Chrome but I have also tested the app (latest version) in Firefox and Safari. All browsers seem to work on my machine.

Everything is basically custom code for selecting those items 🤔

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

Very strange. You would think that FF and Chrome would work basically the same regardless of OS on a PC. Maybe it's a keyup/keydown issue?

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Yea I would assume that the browsers work the same regardless of the OS. So it must be something regarding the OS I assume...

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

So if you roll back to 2.1.0 it should work again but there are a couple of bug fixes missing and also some minor features. But maybe that works for you in the meantime.

Can you verify that this version works for you?

Also, if it worked in 2.1.0 there must be something that broke the functionality on Windows. Tricky to debug now haha.

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

Thank you, I'll give that shot.

from ngx-drag-to-select.

toddhd avatar toddhd commented on May 22, 2024

That seems to be working for now, just a quick smoke test. (Of course, like a dumb-ass, I had modified the CSS and forgot, and blew it away when I rolled back). I'll let you know when I get it put back together.

If I get a chance later, I'll see if I can get the source code and take a look on my machine. I'm not sure if you have a custom environment setup, but it's worth a shot.

Thanks again for the support!

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

No not really a custom setup. You can just clone the repo and install the dependencies. I am doing the same as we speak on my Windows machine to see what's going on. I'll keep you posted.

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

BTW thank you very much for opening this issue. This is really a blocker as it doesn't work properly on Windows anymore.

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

So, I dug into this issue and I was able to pin point this to the keyboard events that apparently behave differently on Windows / Mac. This means that when you press a key and hold it pressed on Mac, the event is fired only once. On Windows this causes the event to be fired repeatedly. This was a problem because for every keyboard event, the temporary list of items (built up in any of the extended selection modes) is cleared. This was causing the items from not being deselected once you start pressing any key, cause there are basically no items to be deselected in the cache... it was already cleared but not flushed.

With the fix that I just pushed, keyboard events should behave consistently and the issue should be fixed. I have also released v3.0.3 on npm which should be now available.

So for now, I am closing this issue because I can no longer reproduce the issue on any platform.

I would appreciate it if you could verify that the fix works on your end too.

Happy testing!

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Uhm ok, Travis is not happy and cannot deploy the new version. I am on it!

from ngx-drag-to-select.

d3lm avatar d3lm commented on May 22, 2024

Ok, v3.0.3 is now available on npm. Give it a try!

from ngx-drag-to-select.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.