+8
-13
lines changedFilter options
+8
-13
lines changed Original file line number Diff line number Diff line change
@@ -93,15 +93,8 @@ trigger element when the target component is closed, and removed when open. As o
93
93
## Preventing the target from opening or closing
94
94
95
95
To prevent the trigger element from toggling the target, set the `disabled` prop on `<button>`,
96
-
`<b-button>`, or `<b-link>` and the toggle event will _not_ dispatched to the target(s).
97
-
98
-
`v-b-toggle` also checks if the `click` event (and `keydown` event for non-button/links) was
99
-
canceled (i.e. via `event.preventDefault()` or `@click.prevent`), and if so, it will _not_ dispatch
100
-
the toggle event to the target(s).
101
-
102
-
Because of this, avoid placing `v-b-toggle` on a `<b-button>` or `<b-link>` that has the `href` prop
103
-
set to `'#'`, as these components (or components based on them) call `event.preventDefault()` to
104
-
stop the browser from scrolling to the top of the page.
96
+
`<b-button>`, or `<b-link>` (or components based on from `<b-link>`) and the toggle event will _not_
97
+
dispatched to the target(s).
105
98
106
99
## Accessibility
107
100
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ export const EVENT_STATE_SYNC = 'bv::collapse::sync::state'
49
49
// Private event we send to collapse to request state update sync event
50
50
export const EVENT_STATE_REQUEST = 'bv::request::collapse::state'
51
51
52
-
const keyDownEvents = [ENTER, SPACE]
52
+
const KEYDOWN_KEY_CODES = [ENTER, SPACE]
53
53
54
54
const RX_SPLIT_SEPARATOR = /\s+/
55
55
@@ -86,9 +86,11 @@ const addClickListener = (el, vnode) => {
86
86
removeClickListener(el)
87
87
if (vnode.context) {
88
88
const handler = evt => {
89
-
const targets = el[BV_TOGGLE_TARGETS] || []
90
-
const ignore = evt.type === 'keydown' && !arrayIncludes(keyDownEvents, evt.keyCode)
91
-
if (!evt.defaultPrevented && !ignore && !isDisabled(el)) {
89
+
if (
90
+
!(evt.type === 'keydown' && !arrayIncludes(KEYDOWN_KEY_CODES, evt.keyCode)) &&
91
+
!isDisabled(el)
92
+
) {
93
+
const targets = el[BV_TOGGLE_TARGETS] || []
92
94
targets.forEach(target => {
93
95
vnode.context.$root.$emit(EVENT_TOGGLE, target)
94
96
})
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4