diff --git a/polygerrit-ui/app/elements/shared/gr-select/gr-select.js b/polygerrit-ui/app/elements/shared/gr-select/gr-select.js index 21e5e1fd3e..5e0cf30e03 100644 --- a/polygerrit-ui/app/elements/shared/gr-select/gr-select.js +++ b/polygerrit-ui/app/elements/shared/gr-select/gr-select.js @@ -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 diff --git a/polygerrit-ui/app/elements/shared/gr-select/gr-select_test.html b/polygerrit-ui/app/elements/shared/gr-select/gr-select_test.html index e7a496503b..2bca29e638 100644 --- a/polygerrit-ui/app/elements/shared/gr-select/gr-select_test.html +++ b/polygerrit-ui/app/elements/shared/gr-select/gr-select_test.html @@ -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);