-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[navs][dropdown] Additional ARIA features #358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Resync with Master
[modal] focusFirst timing tweak (#357)
Adds role="navigation" when the b-nav is not inside a b-navbar
Whenever the show state changes, the 'event collapse::toggle::state' (with args id and state) is emitted on $root. This event Used for setting aria states on controlling trigger element aria-expanded attribute is set based on current state.
Listens for state changes from collapse ('collapse::toggle::state') to set toggle aria atributes
Removed dependency on generate-id aria-labelledby attributes only present if ID is provided
lib/components/collapse.vue
Outdated
created() { | ||
this.$root.$on('collapse::toggle', target => { | ||
if (target !== this.id) { | ||
return; | ||
} | ||
this.toggle(); | ||
}); | ||
this.emitState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are emitting in mounted. So why this is needed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case the receiving components that are already in document need to reflect the state (although it does default to false).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, since the toggle state does default to false, it can probably be removed from create()
and left on mount()
Hmmm
Not sure where this error is originating from. |
lib/components/dropdown.vue
Outdated
@@ -30,7 +31,7 @@ | |||
<div :class="['dropdown-menu',{'dropdown-menu-right': right}]" | |||
ref="menu" | |||
role="menu" | |||
:aria-labelledby="split ? null : _id" | |||
:aria-labelledby="id ? (id + (split ? '__BV_toggle_' : '__BV_button_')) : null)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am think this might be where it is, although I have looked at it 20 times and don't see any typos.
Maybe if I move this to a computed property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arg. now I see it :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D Look and extra closing parentheses (after null)
Removed that pesky closing bracket |
* upstream/master: (220 commits) [button-toolbar] docs (bootstrap-vue#368) ESLint New component b-button-toolbar (bootstrap-vue#367) [link] fix click event [docs] navbar styling Refactor link mixin [button-group] fix toolbar keynav (bootstrap-vue#366) [Docs] ScrollSpy directive JSFiddle [Link] Small fixes [link] Allow both router links and regular links to co-exist in same document (bootstrap-vue#365) [pagination] ARIA attributes + Keyboard navigation (bootstrap-vue#364) [dropdown-item] explicit component reference (bootstrap-vue#361) Additional ARIA on navs and dropdown (bootstrap-vue#358) ESLint [docs] ScrollSpy [scrollspy] SSR fix v0.15.6 [modal] focusFirst timing tweak (bootstrap-vue#357) [scrollspy] documentation update [scrollspy] Documentation (bootstrap-vue#356) ...
Additional/better ARIA attributes (addresses some of #333)
Also removed dependency on generate-id