cssgridgenerator icon indicating copy to clipboard operation
cssgridgenerator copied to clipboard

Clicking "Reset Grid" appears to disable the click & drag motion

Open SeanKilleen opened this issue 6 years ago • 5 comments

Thanks for this awesome site! Dropping this here to start my own investigation and I figure someone else may beat me to the fix, which is fine.

Reproduction

  • Open the site (in my case, in Chrome)
  • Click and drag to create a div
  • Click "Reset Grid" button
  • Attempt to drag over another region to start again

Expected behavior: Drawing still works Actual behavior: Don't seem to be able to click & drag anywhere anymore

Note: the behavior also happens if I click the x on the div prior to resetting the grid. Anytime the button is clicked, it appears the click/drag functionality stops working as well.

No errors in the console or anything that points to an obvious culprit (for me at least).

Screen Capture

2019-06-08_CSSGridGenerator_ResetIssue

SeanKilleen avatar Jun 08 '19 19:06 SeanKilleen

Further investigation:

After building locally and looking at the Vue tools, it looks like once the reset button is clicked, I don't see anything else happening in Vuex; no more addChildren calls are made.

My theory so far (relatively new to Vue) is that the call in store.js to state.childarea = []; is removing something that Vue is listening to by creating a new array rather than emptying the existing array.

SeanKilleen avatar Jun 08 '19 20:06 SeanKilleen

OK, getting a little closer to the actual issue:

It looks like when I click & drag over any one portion of the grid, and then I either click the x on that particular box or click reset, the boxes are removed but the grid doesn't treat that area like it's draggable anymore. It's like the click & drag functionality still has the memory of that box somewhere.

SeanKilleen avatar Jun 08 '19 20:06 SeanKilleen

Hi,

I am facing the same issue. I don't understand vue one bit but can say that when I click on "What does this project do" link it sometimes works properly, otherwise the click and drag gets blocked. I wonder why that is.

Refreshing the page does work so maybe on clicking reset we could do refresh the page and then use this?

Any thoughts from developer or someone else?

Regards,

wpbetterpages avatar Jul 18 '19 17:07 wpbetterpages

Interesting, sorry about that. Definitely a bug. I'm swamped for the next few months but I will look into this as soon as I can. Open to PRs as well.

sdras avatar Oct 06 '19 14:10 sdras

No need to be sorry! :) I'll see if I can PR it; it is Hacktoberfest after all..

SeanKilleen avatar Oct 06 '19 14:10 SeanKilleen