---
title: "webView(_:contextMenuForElement:willCommitWithAnimator:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkuidelegate/webview(_:contextmenuforelement:willcommitwithanimator:)"
---

# webView(_:contextMenuForElement:willCommitWithAnimator:)

Provides the delegate with the animator object that the web view uses to display the contextual menu.

## Declaration

```swift
optional func webView(_ webView: WKWebView, contextMenuForElement elementInfo: WKContextMenuElementInfo, willCommitWithAnimator animator: any UIContextMenuInteractionCommitAnimating)
```

## Parameters

- `webView`: The web view in which the interaction occurred.
- `elementInfo`: An object that contains information about the element involved in the interaction.
- `animator`: The animator object to use to commit additional animations related to the appearance of the contextual menu.

## See Also

### Displaying a contextual menu

- [Adding context menus in your app](uikit/adding-context-menus-in-your-app.md)
- [webView(_:contextMenuConfigurationForElement:completionHandler:)](webkit/wkuidelegate/webview(_:contextmenuconfigurationforelement:completionhandler:).md)
- [webView(_:contextMenuWillPresentForElement:)](webkit/wkuidelegate/webview(_:contextmenuwillpresentforelement:).md)
- [webView(_:contextMenuDidEndForElement:)](webkit/wkuidelegate/webview(_:contextmenudidendforelement:).md)
- [UIContextMenuConfiguration](uikit/uicontextmenuconfiguration.md)
