Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/ExpandablePicker/ExpandablePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ module.exports = kind(
this.selectedIndexChanged();
this.helpTextChanged();
this.createChrome(this.tools);

var controls = this.getCheckboxControls();
for (var i=0; i < controls.length; i++) {
if (controls[i].initSelected) controls[i].initSelected();
}
},

/**
Expand Down
7 changes: 3 additions & 4 deletions src/RadioItem/RadioItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ module.exports = kind(
SelectableItem.prototype.create.apply(this, arguments);
this.removeClass('moon-selectable-item');
this.addClass('moon-radio-item');
if (this.active) {
this.activeChanged();
}
},

/**
Expand All @@ -60,9 +63,5 @@ module.exports = kind(
decorateActivateEvent: function (sender, ev) {
ev.toggledControl = this;
ev.checked = this.selected;
},

initSelected: function() {
if (this.active) this.setSelected(this.active);
}
});
16 changes: 9 additions & 7 deletions src/SelectableItem/SelectableItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ module.exports = kind(
* @private
*/
kind: Item,

/**
* @private
*/
classes: 'moon-selectable-item',

/**
* @private
*/
events: {
onActivate: ''
},

/**
* @private
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = kind(
* @public
*/
active: false,

/**
* If used as the base control within a {@link module:moonstone/DataList~DataList} or {@glossary subkind},
* this should be set to `false` so that selection support can be synchronized to the
Expand All @@ -107,7 +107,7 @@ module.exports = kind(
*/
handleTapEvent: true
},

/**
* @method
* @private
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = kind(
if (this.disabled) {
return true;
}
if (this.handleTapEvent) {
if (this.handleTapEvent && !(this.selected && this.active)) {
this.setActive(!this.getActive());
this.bubble('onchange');
}
Expand Down Expand Up @@ -185,7 +185,9 @@ module.exports = kind(
this.active = utils.isTrue(this.active);
this.setSelected(this.active);
this.resetMarquee();
this.bubble('onActivate');
if (this.active) {
this.bubble('onActivate');
}
},

// Accessibility
Expand Down