react-grid-layout icon indicating copy to clipboard operation
react-grid-layout copied to clipboard

node.offsetParent is sometimes null and messes up with positioning

Open vpezeshkian opened this issue 10 years ago • 4 comments

continuation of #381 , after doing lots of debugging I can see that node.offsetParent sometimes returns null in getControlPosition() helper function.

console.log(node); // constantly returns `react-resizable-handle` dom element
console.log(node.offsetParent); // but this is null sometimes

screen shot 2016-11-01 at 9 25 56 am

vpezeshkian avatar Nov 01 '16 16:11 vpezeshkian

Can you track down when it is null?

vpezeshkian mailto:[email protected] November 1, 2016 at 11:28 AM

continuation of #381 https://github.com/STRML/react-grid-layout/issues/381 , after doing lots of debugging I can see that |node.offsetParent| sometimes returns |null| in |getControlPosition()| helper function.

console.log(node); // constantly returns react-resizable-handle dom element console.log(node.offsetParent); // but this is null sometimes

screen shot 2016-11-01 at 9 25 56 am

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STRML/react-grid-layout/issues/395, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFP1Y71GcBxFbf4bcBnAUoRoNVaMM8ks5q52iZgaJpZM4KmSTS.

STRML avatar Nov 01 '16 16:11 STRML

I'm sure that handleDragStart picks it right, then on first px move handleDrag returns the correct values, but on 2nd px move it's null... how can I go deeper in debugging?

vpezeshkian avatar Nov 01 '16 16:11 vpezeshkian

If you can get a jsfiddle going that replicates it, that would be best - otherwise set some breakpoints & step through it.

vpezeshkian mailto:[email protected] November 1, 2016 at 11:49 AM

I'm sure that |handleDragStart| picks it right, then on first px move |handleDrag| returns the correct values, but on 2nd px move it's |null|... how can I go deeper in debugging?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/STRML/react-grid-layout/issues/395#issuecomment-257620758, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFPyvsISTF8r6Wna-q5gKKTvEjTl5Mks5q522lgaJpZM4KmSTS.

vpezeshkian mailto:[email protected] November 1, 2016 at 11:28 AM

continuation of #381 https://github.com/STRML/react-grid-layout/issues/381 , after doing lots of debugging I can see that |node.offsetParent| sometimes returns |null| in |getControlPosition()| helper function.

console.log(node); // constantly returns react-resizable-handle dom element console.log(node.offsetParent); // but this is null sometimes

screen shot 2016-11-01 at 9 25 56 am

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STRML/react-grid-layout/issues/395, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFP1Y71GcBxFbf4bcBnAUoRoNVaMM8ks5q52iZgaJpZM4KmSTS.

STRML avatar Nov 01 '16 16:11 STRML

This can be closed now... the issue was in css where i had touched z-index of placeholder, so on resize it would sometimes be on top of the drag item and that's why node.offsetParent would be null. Reset the css to master and it's fine... 🏭

vpezeshkian avatar Nov 01 '16 18:11 vpezeshkian