Merge "Fix issue with gr-select when value is 0"
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
},
|
||||
|
||||
_updateValue() {
|
||||
if (this.bindValue) {
|
||||
// It's possible to have a value of 0.
|
||||
if (this.bindValue !== undefined) {
|
||||
// Set for chrome/safari so it happens instantly
|
||||
this.nativeSelect.value = this.bindValue;
|
||||
// Async needed for firefox to populate value. It was trying to do it
|
||||
|
@@ -45,6 +45,11 @@ limitations under the License.
|
||||
element = fixture('basic');
|
||||
});
|
||||
|
||||
test('value of 0 should still trigger value updates', () => {
|
||||
element.bindValue = 0;
|
||||
assert.equal(element.nativeSelect.value, 0);
|
||||
});
|
||||
|
||||
test('bidirectional binding property-to-attribute', () => {
|
||||
const changeStub = sinon.stub();
|
||||
element.addEventListener('bind-value-changed', changeStub);
|
||||
|
Reference in New Issue
Block a user