Skip to content
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

feat(list): Update list to toggle tabindex of radio/checkbox #3542

Merged
merged 7 commits into from
Sep 13, 2018

Conversation

williamernest
Copy link
Contributor

fixes: #3509

@codecov-io
Copy link

codecov-io commented Sep 11, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7f47386). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3542   +/-   ##
=========================================
  Coverage          ?   98.39%           
=========================================
  Files             ?      120           
  Lines             ?     5058           
  Branches          ?      627           
=========================================
  Hits              ?     4977           
  Misses            ?       81           
  Partials          ?        0
Impacted Files Coverage Δ
packages/mdc-list/constants.js 100% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f47386...5123598. Read the comment docs.

@mdc-web-bot
Copy link
Collaborator

All 389 screenshot tests passed for commit 7e5cf49 vs. master! 💯🎉

a list item. The MDCList will perform the following actions for each key press
As the user navigates through the list, any `button`, `a`, `input[type="radio"]` and `input[type="checkbox"]` elements
within the list will receive `tabindex="-1"` when the list item is not focused. When the list item receives focus, the
child `button` and `a` elements will receive `tabIndex="0"`. This allows for the user to tab through list item elements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first sentence was updated but not this one; how about "the aforementioned elements"

@@ -352,7 +352,7 @@ Method Signature | Description
`addClassForElementIndex(index: Number, className: String) => void` | Adds the `className` class to the list item at `index`.
`removeClassForElementIndex(index: Number, className: String) => void` | Removes the `className` class to the list item at `index`.
`focusItemAtIndex(index: Number) => void` | Focuses the list item at the `index` value specified.
`setTabIndexForListItemChildren(index: Number, value: Number) => void` | Sets the `tabindex` attribute to `value` for each child `button` and `a` element in the list item at the `index` specified.
`setTabIndexForListItemChildren(index: Number, value: Number) => void` | Sets the `tabindex` attribute to `value` for each child button, anchor, radio button or checkbox element in the list item at the `index` specified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change "or" back to "and"?

@@ -364,8 +364,8 @@ Method Signature | Description
`setSingleSelection(value: Boolean) => void` | Sets the list to be a selection list. Enables the `enter` and `space` keys for selecting/deselecting a list item.
`setSelectedIndex(index: Number) => void` | Toggles the `selected` state of the list item at index `index`.
`setUseActivated(useActivated: boolean) => void` | Sets the selection logic to apply/remove the `mdc-list-item--activated` class.
`handleFocusIn(evt: Event) => void` | Handles the changing of `tabindex` to `0` for all `button` and `a` elements when a list item receives focus.
`handleFocusOut(evt: Event) => void` | Handles the changing of `tabindex` to `-1` for all `button` and `a` elements when a list item loses focus.
`handleFocusIn(evt: Event) => void` | Handles the changing of `tabindex` to `0` for all button, anchor, radio, or checkbox elements when a list item receives focus.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change "or" back to "and" on these lines?

@@ -34,7 +34,8 @@ const strings = {
ARIA_ORIENTATION: 'aria-orientation',
ARIA_ORIENTATION_HORIZONTAL: 'horizontal',
ARIA_SELECTED: 'aria-selected',
FOCUSABLE_CHILD_ELEMENTS: `.${cssClasses.LIST_ITEM_CLASS} button:not(:disabled), .${cssClasses.LIST_ITEM_CLASS} a`,
FOCUSABLE_CHILD_ELEMENTS: `.${cssClasses.LIST_ITEM_CLASS} button:not(:disabled), .${cssClasses.LIST_ITEM_CLASS} a,
.${cssClasses.LIST_ITEM_CLASS} input[type="radio"], .${cssClasses.LIST_ITEM_CLASS} input[type="checkbox"]`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these also have :not(:disabled)? (I'm not sure what the use case for this is on button)

@mdc-web-bot
Copy link
Collaborator

All 409 screenshot tests passed for commit e0f49b0 vs. master! 💯🎉

@williamernest williamernest merged commit 13abb24 into master Sep 13, 2018
@williamernest williamernest deleted the feat/list/update-focus-behavior branch September 13, 2018 20:45
@jamesmfriedman jamesmfriedman mentioned this pull request Sep 26, 2018
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MDCList: Update focus behavior to include radio/checkbox
5 participants