Skip to content

Commit a89695f

Browse files
authored
Merge pull request #13 from PolymerEl/accessibility
Accessibility
2 parents bc07936 + 5606227 commit a89695f

File tree

4 files changed

+190
-108
lines changed

4 files changed

+190
-108
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "ud-stepper",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Material Design Stepper",
55
"main": "ud-stepper.html",
66
"dependencies": {
77
"polymer": "Polymer/polymer#^2.0.0",
88
"paper-styles": "^2.0.0",
99
"neon-animation": "^2.2.0",
10-
"iron-selector": "^2.0.1",
10+
"iron-menu-behavior": "^2.0.1",
1111
"paper-button": "^2.0.0",
1212
"iron-iconset-svg": "^2.1.0",
1313
"iron-icon": "^2.0.1"

demo/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ <h3>Linear Stepper</h3>
6666
</div>
6767
<demo-snippet>
6868
<template>
69-
<ud-stepper linear sizing="contain" animate>
69+
<ud-stepper id="steps" linear sizing="contain" animate>
7070
<ud-step title="Step 1">
7171
<div> Step 1 Content</div>
72+
<paper-button raised>Content button</paper-button>
7273
</ud-step>
7374
<ud-step title="Step 2 with veeeeeery long title">
7475
<div>Step 2 Content</div>
@@ -224,6 +225,7 @@ <h3>Custom action implementation </h3>
224225
window.addEventListener('WebComponentsReady', function() {
225226
console.info('ready');
226227
app = document.querySelector('#app');
228+
steps = document.querySelector('#steps');
227229

228230
app.next = e => {
229231
e.target.dispatchEvent(new CustomEvent('step-action', { detail: 'next', bubbles: true, composed: true }));

ud-step.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
@apply --ud-step-content-style;
1616
margin: 24px 24px 16px 24px;
1717
}
18+
19+
#content:focus {
20+
outline: none;
21+
}
1822

1923
#actions {
2024
padding: 0px 24px 8px 24px;
@@ -41,7 +45,6 @@
4145

4246
paper-button,
4347
#actions ::slotted(paper-button) {
44-
@apply --paper-font-button;
4548
color: rgba(0, 0, 0, 0.83);
4649
}
4750

@@ -55,6 +58,12 @@
5558
color: rgba(0, 0, 0, 0.50);
5659
background-color: transparent;
5760
}
61+
62+
paper-button:focus,
63+
#actions ::slotted(paper-button:focus) {
64+
background-color: var(--google-grey-300);
65+
66+
}
5867
</style>
5968
<div id="content">
6069
<slot></slot>
@@ -135,7 +144,7 @@
135144
},
136145

137146
/*
138-
* `alwaysSelectable` true to allow the step to always be selectable, even if linead and completed
147+
* `alwaysSelectable` true to allow the step to always be selectable, even if linear and completed
139148
*/
140149
alwaysSelectable: {
141150
type: Boolean,
@@ -243,10 +252,6 @@
243252
return ['_updateActionsButtons(_actionButtons.*,_linearActionButtons.*,actions.*)'];
244253
}
245254

246-
ready() {
247-
super.ready();
248-
}
249-
250255
connectedCallback() {
251256
super.connectedCallback();
252257
if (this.hideActions) return;
@@ -305,7 +310,7 @@
305310
_errorChanged(invalid) {
306311
this.dispatchEvent(new CustomEvent('step-error', {
307312
detail: {
308-
stpe: this
313+
step: this
309314
},
310315
bubbles: true
311316
}));
@@ -314,6 +319,12 @@
314319
_reset() {
315320
this.completed = false;
316321
}
322+
323+
setFocus() {
324+
const content = this.$.content;
325+
content.setAttribute('tabindex', '0');
326+
content.focus();
327+
}
317328
}
318329

319330
window.customElements.define(UdStepElement.is, UdStepElement);

0 commit comments

Comments
 (0)