{"record":{"id":"7116aa3d4d1b7dee","repo":"angular/components","slug":"found-use-of-deprecated-attribute-cdk-focus-initi","errorCode":null,"errorMessage":"Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead. The deprecated attribute will be removed in 8.0.0","messagePattern":"Found use of deprecated attribute 'cdk-focus-initial', use 'cdkFocusInitial' instead\\. The deprecated attribute will be removed in 8\\.0\\.0","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/cdk/a11y/focus-trap/focus-trap.ts","lineNumber":230,"sourceCode":"  }\n\n  /**\n   * Focuses the element that should be focused when the focus trap is initialized.\n   * @returns Whether focus was moved successfully.\n   */\n  focusInitialElement(options?: FocusOptions): boolean {\n    // Contains the deprecated version of selector, for temporary backwards comparability.\n    const redirectToElement = this._element.querySelector(\n      `[cdk-focus-initial], ` + `[cdkFocusInitial]`,\n    ) as HTMLElement;\n\n    if (redirectToElement) {\n      // @breaking-change 8.0.0\n      if (\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n        redirectToElement.hasAttribute(`cdk-focus-initial`)\n      ) {\n        console.warn(\n          `Found use of deprecated attribute 'cdk-focus-initial', ` +\n            `use 'cdkFocusInitial' instead. The deprecated attribute ` +\n            `will be removed in 8.0.0`,\n          redirectToElement,\n        );\n      }\n\n      // Warn the consumer if the element they've pointed to\n      // isn't focusable, when not in production mode.\n      if (\n        (typeof ngDevMode === 'undefined' || ngDevMode) &&\n        !this._checker.isFocusable(redirectToElement)\n      ) {\n        console.warn(`Element matching '[cdkFocusInitial]' is not focusable.`, redirectToElement);\n      }\n\n      if (!this._checker.isFocusable(redirectToElement)) {\n        const focusableChild = this._getFirstTabbableElement(redirectToElement) as HTMLElement;","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/cdk/a11y/focus-trap/focus-trap.ts#L212-L248","documentation":"FocusTrap's initial-focus marker was renamed from cdk-focus-initial to cdkFocusInitial. When the trap resolves its initial focus target and finds the old kebab-case attribute, it warns in dev mode that the old name will be removed in 8.0.0.","triggerScenarios":"focusInitialElement (invoked via focusInitialElementWhenReady) finds the redirect target element still carrying the attribute cdk-focus-initial while ngDevMode is on.","commonSituations":"Legacy templates predating the attribute rename; upgraded applications that kept old focus-trap markup; following outdated tutorials.","solutions":["Rename cdk-focus-initial to cdkFocusInitial in the template","Grep templates for 'cdk-focus-initial' and fix all instances","Migrate before Angular 8.0.0 where the deprecated attribute is removed"],"exampleFix":"// before\n<button cdk-focus-initial>Save</button>\n// after\n<button cdkFocusInitial>Save</button>","handlingStrategy":"validation","validationCode":"if (document.querySelector('[cdk-focus-initial]')) {\n  console.warn('Deprecated cdk-focus-initial found; use cdkFocusInitial');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use cdkFocusInitial in new templates","Grep for cdk-focus-initial during upgrade prep","Document the marker attribute convention for your team"],"tags":["deprecation","focus-trap","a11y","angular-cdk"],"backgroundTag":"deprecated-attribute","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}