Drag and drop not working

I have created a custom keyword via the actions object. this allows you to select a source and destination webelement and within the destination you can define your offset (where in the destination object you want to drop it. it is based on the actions object

snippet code is this(do not forget to add these imports into the code)

import com.kms.katalon.core.webui.common.WebUiCommonHelper

import org.openqa.selenium.interactions.Action

import org.openqa.selenium.interactions.Actions

import org.openqa.selenium.WebDriver

import java.time.Duration

public class DragDrop {

@Keyword

def dragdrop(TestObject to,TestObject destination,Integer intX,Integer intY) {

def eleto = WebUiCommonHelper.findWebElement(to, 30)

def eledest = WebUiCommonHelper.findWebElement(destination, 30)

WebDriver driver = DriverFactory.getWebDriver()

Actions build = new Actions(driver)

.moveToElement(eleto)

.pause(Duration.ofSeconds(3))

.clickAndHold(eleto)

.moveByOffset(1, 0)

.moveToElement(eledest,intX,intY)

//.moveByOffset(40, 0)

.pause(Duration.ofSeconds(5))

.release().perform()

}

}

good luck