Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
MenuItem: support the aria-expanded state (w3c/aria#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristov committed May 21, 2018
1 parent 9eb29b4 commit ce7c3b5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/menuitem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Div } from 'htmlmodule/lib/div'
import { Expanded } from './aria/expanded'
import { Command } from './command'
import { Menu } from './menu'

Expand Down Expand Up @@ -95,6 +96,20 @@ export class MenuItem extends Command {
this.focus()
}

/**
* @param {String} expanded
*/
set expanded(expanded) {
this.setAttribute(Expanded, expanded)
}

/**
* @returns {String}
*/
get expanded() {
return this.getAttribute(Expanded)
}

/**
* @param {Boolean} hidden
*/
Expand Down

0 comments on commit ce7c3b5

Please sign in to comment.