feat(FocusTrap): focus methods should accept focus options #21767
Labels
area: cdk/a11y
feature
This issue represents a new feature or feature request rather than a bug or bug fix
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Feature Description
FocusTrap
methods should accept focus parameters.Methods to change:
focusFirstTabbableElement()
focusFirstTabbableElementWhenReady()
focusInitialElement()
focusInitialElementWhenReady()
focusLastTabbableElement()
focusLastTabbableElementWhenReady()
Example:
Use Case
Using a
FocusTrap
to focus an element that starts out of view can cause parent elements to shift as the browser tries to bring the element into view. Allowing focus parameters to be configured, will enable consumers to set thepreventScroll
option and prevent this behavior (in supporting browsers).Stackblitz demoing a scenario where the ability to specify focus parameters would be helpful.
Maybe be related to #17863
The text was updated successfully, but these errors were encountered: