# Upgrade guide for Grid v5.4.0

## RowCopyPaste has been made asynchronous

The RowCopyPaste feature's `copyRows` and `pasteRows` has been made asynchronous. This makes the `beforeCopy` and
`beforePaste` events asynchronously preventable and allows for native Clipboard API support.

If your code relies on a copy or paste action to complete, you will need to wait for the promise to be resolved.

**Old code:**

```javascript
function copyPaste()
{
    grid.copyRows();
    doSomethingElse();
    grid.pasteRows();
    finishDoingSomethingElse();
}
```

**New code:**

```javascript
async function copyPaste()
{
    await grid.copyRows();
    doSomethingElse();
    await grid.pasteRows();
    finishDoingSomethingElse();
}
```

...or...

```javascript
function copyPaste()
{
    return grid.copyRows().then(() => {
        doSomethingElse();
        grid.pasteRows().then(() => {
            finishDoingSomethingElse();
            return true;
        });
    });
}
```


<p class="last-modified">Last modified on 2023-10-26 8:19:11</p>