File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -999,9 +999,18 @@ focus a form control when the modal opens. Note that the `autofocus` prop will n
999999` b-modal ` if the ` static ` prop is used without the ` lazy ` prop set, as ` autofocus ` happens when the
10001000` b-form-* ` controls are _ mounted in the DOM_ .
10011001
1002- ** Note:** it is ** not recommended** to autofocus an input inside a modal for accessibility reasons,
1003- as screen reader users will not know the context of where the input is. It is best to let
1004- ` <b-modal> ` focus the modal's container and then allow the user to tab into the input.
1002+ If you want to auto focus one of the _ built-in_ modal buttons (` ok ` , ` cancel ` or the header ` close `
1003+ button, you can set the prop ` auto-focus-button ` to one of the values ` 'ok' ` , ` 'cancel' ` or ` 'close' `
1004+ and ` <b-modal> ` will focus the specified button if it exists. This feature is also available for
1005+ modal message boxes.
1006+
1007+ <p class =" alert alert-warning " >
1008+ <strong >Note:</strong > it is <strong >not recommended</strong > to autofocus an input or control
1009+ inside of a modal for accessibility reasons, as screen reader users will not know the context of
1010+ where the input is (the announcment of the modal may not be spoken). It is best to let
1011+ <code >< ; b-modal> ; </code > focus the modal's container, allowing the modal information to be
1012+ spoken to the user, and then allow the user to tab into the input.
1013+ </p >
10051014
10061015### Returning focus to the triggering element
10071016
You can’t perform that action at this time.
0 commit comments