{"record":{"id":"b854edf063f0041a","repo":"microsoft/playwright","slug":"result-hittargetdescription-intercepts-pointer","errorCode":null,"errorMessage":"${result.hitTargetDescription} intercepts pointer events","messagePattern":"(.+?) intercepts pointer events","errorType":"exception","errorClass":"NonRecoverableDOMError","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/dom.ts","lineNumber":366,"sourceCode":"          throw new NonRecoverableDOMError('Element is outside of the viewport');\n        progress.log('  element is outside of the viewport');\n        continue;\n      }\n      if (result === 'error:optionsnotfound') {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError('Did not find some options');\n        progress.log('  did not find some options');\n        continue;\n      }\n      if (result === 'error:optionnotenabled') {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError('Option being selected is not enabled');\n        progress.log('  option being selected is not enabled');\n        continue;\n      }\n      if (typeof result === 'object' && 'hitTargetDescription' in result) {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError(`${result.hitTargetDescription} intercepts pointer events`);\n        progress.log(`  ${result.hitTargetDescription} intercepts pointer events`);\n        continue;\n      }\n      if (typeof result === 'object' && 'missingState' in result) {\n        if (noAutoWaiting)\n          throw new NonRecoverableDOMError(`Element is not ${result.missingState}`);\n        progress.log(`  element is not ${result.missingState}`);\n        continue;\n      }\n      return result;\n    }\n  }\n\n  async _retryPointerAction(progress: Progress, actionName: ActionName, waitForEnabled: boolean, action: (progress: Progress, point: types.Point) => Promise<void>,\n    options: { waitAfter: boolean | 'disabled' } & types.PointerActionOptions & types.PointerActionWaitOptions): Promise<'error:notconnected' | 'done'> {\n    // Note: do not perform locator handlers checkpoint to avoid moving the mouse in the middle of a drag operation.\n    const skipActionPreChecks = actionName === 'move and up';\n    return await this._retryAction(progress, actionName, async (progress, retry) => {","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/dom.ts#L348-L384","documentation":"The action returned an object with a `hitTargetDescription`, meaning another element is covering the target at the click point and intercepting pointer events (elementFromPoint returns a different node). With force:true or noAutoWaiting the loop cannot wait for the overlay to disappear, so it throws NonRecoverableDOMError including a description of the intercepting element.","triggerScenarios":"Calling a pointer action with force:true while a modal, tooltip, cookie banner, loading overlay, or sticky header sits on top of the target; an element momentarily covered by a transition.","commonSituations":"Cookie consent banners; full-screen loaders; `position:absolute` overlays; toast notifications appearing over the button under test when force was used to skip waiting.","solutions":["Remove force:true so Playwright waits for the intercepting element to disappear.","Dismiss the overlay first (click the cookie-banner accept, wait for the loader to hide).","Use a click position that is not covered, or scroll so the target is clear of the overlay.","Check the error's hitTargetDescription to identify what is intercepting."],"exampleFix":"// before\nawait page.locator('#save').click({ force: true }); // overlay covers it → throws\n// after\nawait page.locator('#cookie-accept').click();\nawait page.locator('#save').click(); // auto-wait clears the overlay","handlingStrategy":"retry","validationCode":"// Dismiss the overlay or remove force so auto-wait clears it.\nawait page.locator('#cookie-accept').click().catch(() => {});\nawait locator.click(); // no force → waits for nothing intercepting","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid force:true when overlays may be present; rely on auto-wait.","Dismiss known overlays (cookie banners, loaders) before interacting.","Read the error's hitTargetDescription to identify the interceptor."],"tags":["dom","actionability","overlay","pointer-events","force"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}