Skip to content

Instantly share code, notes, and snippets.

View Yash-Singh1's full-sized avatar
bruh no

Yash Singh Yash-Singh1

bruh no
View GitHub Profile
Yash-Singh1 / dnd.ts
Created December 30, 2023 22:15
Drag and Drop Simulation Function that works with Notion Calendar View
// This took me forever to get right, but basically it just plays around with mouse events to simulate a drag and drop in Notion Calendars
function dragAndDrop(initial: HTMLElement, target: HTMLElement) {
const pickUpEvent = new MouseEvent("mousedown", {
// button: 1,
bubbles: true,
// clientX: initial.getBoundingClientRect().x,
// clientY: initial.getBoundingClientRect().y,