@@ -59,7 +59,7 @@ export default{
5959 <b-button v-b-modal.modal-1>Launch demo modal</b-button>
6060
6161 <b-modal id="modal-1" title="BootstrapVue">
62- <FocusLoop>
62+ <FocusLoop :is-visible="isOpen" >
6363 <b-form @submit="onSubmit" @reset="onReset" v-if="show">
6464 <b-form-group id="input-group-2" label="Your Name:" label-for="input-1">
6565 <b-form-input
@@ -89,43 +89,30 @@ export default{
8989</template>
9090```
9191
92- ## Disable loop
93-
94- You can disable the focus trap and activate it only when you really need it.
92+ ## Make the focus-loop container visible and rendered
9593
9694prop | type | default
9795---------- | --------- | ------------
98- disabled | ` Boolean ` | ` false `
99-
100- For example:
96+ isVisible | ` Boolean ` | ` false `
10197
10298``` html
103-
104- <FocusLoop disabled >
99+ <FocusLoop :is-visible =" isOpen" >
105100<!-- your elements here -->
106101</FocusLoop >
107-
108102```
109103
110- ## Focus in first element
111-
112- There are 2 ways in which ` <FocusLoop> ` sets the focus on the first element.
113-
114- Using ` v-if ` , for example ` <FocusLoop v-if="isSidebarOpen"> ` , the first element is automatically focused when ` mounted ` .
104+ ## Disable loop
115105
116- If you have ` <FocusLoop> ` mounted, but hidden using CSS, you can set the focus on the first element when visible .
106+ You can disable the focus trap and activate it only when you really need it .
117107
118- prop | type | default
119- ----------- | --------- | ------------
120- isVisible | ` Boolean ` | ` false `
108+ prop | type | default
109+ ---------- | --------- | ------------
110+ disabled | ` Boolean ` | ` false `
121111
122112For example:
123113
124114``` html
125- <FocusLoop
126- :is-visible =" isSidebarOpen"
127- :disabled =" !isSidebarOpen"
128- >
115+ <FocusLoop :is-visible =" isOpen" disabled >
129116<!-- your elements here -->
130117</FocusLoop >
131118```
@@ -141,7 +128,7 @@ autoFocus | `Boolean` | `true`
141128For example:
142129
143130``` html
144- <FocusLoop :auto-focus =" false" >
131+ <FocusLoop :is-visible = " isOpen " : auto-focus =" false" >
145132<!-- your elements here -->
146133</FocusLoop >
147134```
0 commit comments