I am currently developing a card drag-and-drop board using HTML5
inspired by Trello.
My focus right now is on connecting the lists to specific list slots/containers.
My challenge lies in determining which list container is positioned beneath the mouse pointer when the list is released (onMouseUp
). This information is crucial for attaching the list to the correct container.
At present, I am struggling to identify the container element under the mouse cursor. The issue arises because the list is directly under the mouse when attempting to identify its surroundings.
Obtaining the parent element of the dragged list is problematic since the parent element remains constant while the list is dragged and its top and left attributes are modified.
In essence, I need to identify what lies under the mouse cursor, excluding the list being dragged. When the drag occurs over list slot 1, I need to capture that specific element; likewise, when moving over list slot 2, I need to detect that element.
import React, { useEffect, useState } from "react";
// Rest of the JavaScript code here...
This is where my progress stands at the moment.
Any guidance or assistance would be greatly appreciated.