<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKUIDelegate/webView(_:contextMenuForElement:willCommitWithAnimator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKUIDelegate(im)webView:contextMenuForElement:willCommitWithAnimator:"
  },
  "title" : "webView(_:contextMenuForElement:willCommitWithAnimator:)"
}
-->

# webView(_:contextMenuForElement:willCommitWithAnimator:)

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

```
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.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)