Skip to content

[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

Merged
merged 17 commits into from
May 8, 2017
Merged

[navs][dropdown] Additional ARIA features #358

merged 17 commits into from
May 8, 2017

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented May 8, 2017

Additional/better ARIA attributes (addresses some of #333)

Also removed dependency on generate-id

tmorehouse added 15 commits May 8, 2017 05:31
[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
created() {
this.$root.$on('collapse::toggle', target => {
if (target !== this.id) {
return;
}
this.toggle();
});
this.emitState();
Copy link
Member

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 ?

Copy link
Member Author

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).

Copy link
Member Author

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()

@tmorehouse
Copy link
Member Author

Hmmm

rollup -c build/rollup.config.js 
  (vue plugin) Unexpected token (1:1156)
undefined (1:1156)

Not sure where this error is originating from.

@@ -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)"
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member

@pi0 pi0 May 8, 2017

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)

@tmorehouse
Copy link
Member Author

Removed that pesky closing bracket

@pi0 pi0 merged commit 7c82491 into bootstrap-vue:master May 8, 2017
valexiev added a commit to valexiev/bootstrap-vue that referenced this pull request May 9, 2017
* 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)
  ...
@tmorehouse tmorehouse changed the title Additional ARIA on navs and dropdown [navs][dropdown] Additional ARIA features Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants