Skip to content

docs: add doc to focusBoundControl feature#67667

Open
rblmdst wants to merge 2 commits intoangular:mainfrom
rblmdst:doc-focus-bound-control
Open

docs: add doc to focusBoundControl feature#67667
rblmdst wants to merge 2 commits intoangular:mainfrom
rblmdst:doc-focus-bound-control

Conversation

@rblmdst
Copy link
Contributor

@rblmdst rblmdst commented Mar 12, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@google-cla
Copy link

google-cla bot commented Mar 12, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pullapprove pullapprove bot requested a review from devversion March 12, 2026 23:34
@angular-robot angular-robot bot added the area: docs Related to the documentation label Mar 12, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 12, 2026
@rblmdst rblmdst force-pushed the doc-focus-bound-control branch from 577edbf to 20f3aeb Compare March 12, 2026 23:47
@google-cla google-cla bot added cla: yes and removed cla: no labels Mar 12, 2026
@Component({/* ... */})
export class PasswordInput implements FormValueControl<string> {
readonly value = model<string>('');
readonly passwordCtrl = viewChild.required<ElementRef>('passwordCtrl');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can specify the type in the generic ElementRef so we avoid having to do the casting later.

Suggested change
readonly passwordCtrl = viewChild.required<ElementRef>('passwordCtrl');
readonly passwordCtrl = viewChild.required<ElementRef<HTMLInputElement>>('passwordCtrl');

@JeanMeche JeanMeche requested review from bencodezen and removed request for devversion March 13, 2026 00:24

### Preventing scroll

If the target control is outside the viewport and you want to focus it without triggering a scroll, pass `{ preventScroll: true }`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a link in preventScroll or in focus to clarify what preventScroll does. Normally we reference MDN for this

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#preventscroll

@JeanMeche
Copy link
Member

The topic covered seem to be a bit small the justify a dedicated guide. Also currently this file is orphan, it's isn't referenced in adev/src/app/routing/navigation-entries/index.ts and thus cannot by navigated to (nor is it present in the navigation page).

@rblmdst rblmdst requested a review from SkyZeroZx March 13, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adev: preview area: docs Related to the documentation cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants