@@ -59,7 +59,7 @@ export default {
59
59
<b-button v-b-modal.modal-1>Launch demo modal</b-button>
60
60
61
61
<b-modal id="modal-1" title="BootstrapVue">
62
- <FocusLoop>
62
+ <FocusLoop :is-visible="isOpen" >
63
63
<b-form @submit="onSubmit" @reset="onReset" v-if="show">
64
64
<b-form-group id="input-group-2" label="Your Name:" label-for="input-1">
65
65
<b-form-input
@@ -89,43 +89,30 @@ export default {
89
89
</template>
90
90
```
91
91
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
95
93
96
94
prop | type | default
97
95
---------- | --------- | ------------
98
- disabled | ` Boolean ` | ` false `
99
-
100
- For example:
96
+ isVisible | ` Boolean ` | ` false `
101
97
102
98
``` html
103
-
104
- <FocusLoop disabled >
99
+ <FocusLoop :is-visible =" isOpen" >
105
100
<!-- your elements here -->
106
101
</FocusLoop >
107
-
108
102
```
109
103
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
115
105
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 .
117
107
118
- prop | type | default
119
- ----------- | --------- | ------------
120
- isVisible | ` Boolean ` | ` false `
108
+ prop | type | default
109
+ ---------- | --------- | ------------
110
+ disabled | ` Boolean ` | ` false `
121
111
122
112
For example:
123
113
124
114
``` html
125
- <FocusLoop
126
- :is-visible =" isSidebarOpen"
127
- :disabled =" !isSidebarOpen"
128
- >
115
+ <FocusLoop :is-visible =" isOpen" disabled >
129
116
<!-- your elements here -->
130
117
</FocusLoop >
131
118
```
@@ -141,7 +128,7 @@ autoFocus | `Boolean` | `true`
141
128
For example:
142
129
143
130
``` html
144
- <FocusLoop :auto-focus =" false" >
131
+ <FocusLoop :is-visible = " isOpen " : auto-focus =" false" >
145
132
<!-- your elements here -->
146
133
</FocusLoop >
147
134
```
0 commit comments