@@ -160,11 +160,37 @@ If a popover has more than one trigger, then all triggers must be cleared before
160160close. I.e. if a popover has the trigger ` focus click ` , and it was opened by ` focus ` , and the user
161161then clicks the trigger element, they must click it again ** and** move focus to close the popover.
162162
163+ ### Caveats with ` focus ` trigger on ` <button> ` elements
164+
165+ For proper cross-browser and cross-platform behavior when using only the ` focus ` trigger, you must
166+ use an element that renders the ` <a> ` tag, not the ` <button> ` tag, and you also must include a
167+ ` tabindex="0" ` attribute.
168+
169+ The following will generate an ` <a> ` that looks like a button:
170+
171+ ``` html
172+ <b-button
173+ href =" #"
174+ tabindex =" 0"
175+ v-b-popover.focus =" 'Popover content'"
176+ title =" Popover title"
177+ >
178+ Link button with popover directive
179+ </b-button >
180+
181+ <b-button id =" link-button" href =" #" tabindex =" 0" >
182+ Link button with popover component
183+ </b-button >
184+ <b-popover target =" link-button" title =" Popover title" triggers =" focus" >
185+ Popover content
186+ </b-popover >
187+ ```
188+
163189### Dismiss on next click (self-dismissing)
164190
165191Use the ` focus ` trigger by itself to dismiss popovers on the next click that the user makes. ` focus `
166192also makes the popover activate on both ` focus ` and ` click ` (as a click makes the element receive
167- focus, assuming it is in the tab sequence of the page).
193+ focus on most browsers , assuming it is in the tab sequence of the page).
168194
169195You can, however, specify your trigger as ` click blur ` , which will make only a click activate the
170196popover, and either a click on the element, _ or_ losing focus to another element or part of the
@@ -274,7 +300,7 @@ prop:
274300
275301``` html
276302<div class =" text-center" >
277- <b-button id =" popover-button-variant" >Button</b-button >
303+ <b-button id =" popover-button-variant" href = " # " tabindex = " 0 " >Button</b-button >
278304 <b-popover target =" popover-button-variant" variant =" danger" triggers =" focus" >
279305 <template v-slot:title >Danger!</template >
280306 Danger variant popover
0 commit comments