mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 18:17:38 +00:00
Fix how we calculate the position of trackes dropped into the playlist
Fixes #688
This commit is contained in:
parent
291b518765
commit
b074e0eff3
1 changed files with 5 additions and 3 deletions
|
|
@ -19,12 +19,14 @@ export default class DropTarget extends React.Component<Props> {
|
|||
|
||||
handleDrop = (e: React.DragEvent<HTMLDivElement>) => {
|
||||
this.supress(e);
|
||||
const { target } = e;
|
||||
if (!(target instanceof Element)) {
|
||||
// TODO: We could probably move this coordinate logic into the playlist.
|
||||
// I think that's the only place it gets used.
|
||||
const { currentTarget } = e;
|
||||
if (!(currentTarget instanceof Element)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { left: x, top: y } = target.getBoundingClientRect();
|
||||
const { left: x, top: y } = currentTarget.getBoundingClientRect();
|
||||
this.props.handleDrop(e, { x, y });
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue