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

Allow passing of dimensions for fixed width/height draggables? (Potential performance enhancement) #1111

Closed
tjramage opened this issue Feb 17, 2019 · 4 comments

Comments

@tjramage
Copy link

Feature request

I understand that a lot of work is done during dimension capturing immediately prior to a drag starting. Forgive me, as I am not fully informed here, but I assume that this stage is interested in getting the dimensions of droppables AND draggables?

If so, I was wondering if a potential performance enhancement would be to allow the passing of a draggableWidth and draggableHeight prop to the DragDropContext (or Droppable) component for cases where the draggable items have fixed dimensions.

This would (hopefully) remove the need to, at the very least, calculate the dimensions of each draggable every time a drag action occurs, which may help squeeze a bit more out in terms of performance? Obviously this would only be applicable to implementations where draggable item dimensions are indeed fixed...

@alexreardon
Copy link
Collaborator

Possibly. We collect a lot of information including padding, margin etc.

From my investigations the collection is not bad. Doing it with too many things is expensive. I expect that for when you have a list > 500 things using a virtual list would resolve any performance issues like this

@alexreardon
Copy link
Collaborator

#68

@tjramage
Copy link
Author

Hey @alexreardon, hope the presentation in Sydney went well! 😉

No worries. I guess I was just thinking of ways we could improve performance in order to get around the need for virtualisation (in the short-term). The thinking behind that being it might be quicker and easier to support parameterised widths/heights. I'm definitely onboard with virtual lists being the 'real' solution to this issue though (and I'd love to see support for that over this!).

@alexreardon
Copy link
Collaborator

Thanks @tjramage. Please keep the suggestions coming!

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

No branches or pull requests

2 participants