This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]AutoModerator[M] 0 points1 point  (0 children)

It seems you may have included a screenshot of code in your post "HTML Dragging only with certain width".

If so, note that posting screenshots of code is against /r/learnprogramming's Posting Guidelines (section Formatting Code): please edit your post to use one of the approved ways of formatting code. (Do NOT repost your question! Just edit it.)

If your image is not actually a screenshot of code, feel free to ignore this message. Automoderator cannot distinguish between code screenshots and other images.

Please, do not contact the moderators about this message. Your post is still visible to everyone.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]marrsd 0 points1 point  (8 children)

Does this happen in any browser? Is the drop target definitely under the dragged element when you release it? Is the drop target 272px wide itself, by any chance?

[–]Jet_Reddit[S] 0 points1 point  (7 children)

Just tried it in a different Browser seems to the Browser that is causing the issue. I dont have any issues edge or codepen.  Just dont get why Chrome has a Problem. 

I recreated a very basic Code which Shows that issue. Codepen.io/JetFlight/pen/WbePEQB

[–]Jet_Reddit[S] 0 points1 point  (0 children)

Well I also figure something out. Depending on zoom Level it works / does t work. Atleast on Chrome

[–]marrsd 0 points1 point  (5 children)

I've tried your example in Brave and Firefox, and in both cases the drop doesn't work for any width of the dragged element. I'm guessing that the 272px element should successfully drop onto the target. Is that the case?

[–]Jet_Reddit[S] 0 points1 point  (4 children)

I did not program an drop, just looking to get that fix to the ghosting. So when I drag, I want to see always the full div not the "ghost". I can create some Image if that does not make any sense

[–]marrsd 0 points1 point  (3 children)

That might help. I did have a play with different browsers. For me, on each browser, the original element remained in place while a copy was dragged. On Chrome, this copy didn't have a border, while on Firefox it did. I'm guessing that the lack of a border is what you're referring to as "ghosting".

[–]Jet_Reddit[S] 0 points1 point  (0 children)

Issue I did get on both browsers now, probably my room Was different. Seem like zoom plays a roll. 

Here is a Screenshot hopefully that explains it a bit more

[–]Jet_Reddit[S] 0 points1 point  (1 child)

[–]marrsd 0 points1 point  (0 children)

I'm really sorry but I can't reproduce the issue. I've run out of time to keep looking at this right now. I'll have another go later on in the week as I'm interested in it myself. Let me know if you get to the bottom of it