Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js

Issue 2715763002: MD-Settings A11y: Disable radio list if all options are disabled. (Closed)
Patch Set: move the tabindex Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/people_page/sync_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Polymer({ 1 Polymer({
2 is: 'paper-radio-group', 2 is: 'paper-radio-group',
3 3
4 behaviors: [ 4 behaviors: [
5 Polymer.IronMenubarBehavior 5 Polymer.IronMenubarBehavior
6 ], 6 ],
7 7
8 hostAttributes: { 8 hostAttributes: {
9 role: 'radiogroup', 9 role: 'radiogroup',
10 tabindex: 0
11 }, 10 },
12 11
13 properties: { 12 properties: {
14 /** 13 /**
15 * Fired when the radio group selection changes. 14 * Fired when the radio group selection changes.
16 * 15 *
17 * @event paper-radio-group-changed 16 * @event paper-radio-group-changed
18 */ 17 */
19 18
20 /** 19 /**
(...skipping 19 matching lines...) Expand all
40 type: String, 39 type: String,
41 value: 'paper-radio-button' 40 value: 'paper-radio-button'
42 }, 41 },
43 42
44 /** 43 /**
45 * If true, radio-buttons can be deselected 44 * If true, radio-buttons can be deselected
46 */ 45 */
47 allowEmptySelection: { 46 allowEmptySelection: {
48 type: Boolean, 47 type: Boolean,
49 value: false 48 value: false
50 } 49 },
50
51 disabled: {
52 type: Boolean,
53 observer: '_onDisableChange',
Dan Beam 2017/02/23 20:49:14 nit: changed
54 },
51 }, 55 },
52 56
53 /** 57 /**
54 * Selects the given value. 58 * Selects the given value.
55 */ 59 */
56 select: function(value) { 60 select: function(value) {
57 var newItem = this._valueToItem(value); 61 var newItem = this._valueToItem(value);
58 if (newItem && newItem.hasAttribute('disabled')) { 62 if (newItem && newItem.hasAttribute('disabled')) {
59 return; 63 return;
60 } 64 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 }, 104 },
101 105
102 _onLeftKey: function(event) { 106 _onLeftKey: function(event) {
103 Polymer.IronMenubarBehaviorImpl._onLeftKey.apply(this, arguments); 107 Polymer.IronMenubarBehaviorImpl._onLeftKey.apply(this, arguments);
104 this._activateFocusedItem(); 108 this._activateFocusedItem();
105 }, 109 },
106 110
107 _onRightKey: function(event) { 111 _onRightKey: function(event) {
108 Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this, arguments); 112 Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this, arguments);
109 this._activateFocusedItem(); 113 this._activateFocusedItem();
110 } 114 },
111 }); 115
116 _onDisableChange: function(disabled) {
117 if (disabled)
118 this.removeAttribute('tabindex');
119 else
120 this.tabindex = 0;
121 },
122 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/sync_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698