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

Workaround for undefined width/height during drag/drop #641

Closed
wants to merge 1 commit into from

Conversation

swarnat
Copy link

@swarnat swarnat commented Apr 23, 2017

Hy,

Working with this great JS Library, throw an exception placeholder.attr(..).attr(..).attr(..).attr(..) is not a function.
During a Debug session, I recognize, that during Drag&Drop the Width and Height of Placeholder is "undefined".

I tried to enable the width calculation, but this don't work, because Resizing is not initialized. (Correct)

If I look at this part of code, I understand why it don't work, because width is undefined and the attr(...) function with undefined second parameter returns the value of attribute and not the element.

I don't fully understand, when and why node._temporaryRemoved is true AND width is undefined, because I think if this happens, the placeholder would be initialized with wrong width. But everything works like it should in my environment.

Maybe this PR is only a workaround for another issue. I will further check the function.

Regards,

Stefan

PS: I use jQuery 1.x, because your library will work within another software, which force this version.
It works without problems.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 70.634% when pulling 2bf5e2a on RedooNetworks:develop into 8ea752d on troolee:develop.

@radiolips
Copy link
Member

@swarnat I'm able to drag and drop without problem. Could you provide a jsfiddle so I can better understand what this fixes?

@swarnat
Copy link
Author

swarnat commented Apr 23, 2017

Hy,
Thanks for response and please forget it.
I invest some time and recognize this behaviour was changed with jQuery 1.7.2 (https://bugs.jquery.com/ticket/9427)
Because you request version 3 of jquery, the error is not a big problem.
Unfortunately the CRM I use, still use jQuery 1.7.0 and behave different in this situation.

I create this JSFiddle with jQuery 1.7.1:
https://jsfiddle.net/8pdk54p2/1/

You could reconstruct the "bug", if you Drag the "Content B" Item over the text "Headline", so the Placeholder will be temporarily removed. It occurs during recreation of Placeholder and destroy the complete grid.

I will use your library with this modification and during next major update of CRM, which update jQuery to 1.11, it is getting cleared.

Stefan

@radiolips radiolips closed this May 6, 2017
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

Successfully merging this pull request may close these issues.

3 participants