Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

2.0 preview #94

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
before_script:
- npm install -g bower polylint web-component-tester
- bower install
- polylint
#- polylint
env:
global:
- secure: NQunbnhwQFU/uRU1Dz8VIYXpG9cq4wEldllph4To1XJqEa21pG1Q9+a/M4+aOkW6iIPRgfI/bQ6mPWaRnE/KGrsusARqgYDytq42dJpSoLOiLYbVdRKIHI3t9cr1MiZKUxwz/vpOsKcMK8dW5RmR6zJ8k5roijNAmjFRlzfGOKY=
Expand Down
11 changes: 4 additions & 7 deletions iron-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,13 @@

attached: function() {
this._initSlottedInput();

// If the input is added at a later time, update the internal reference.
this._observer = Polymer.dom(this).observeNodes(function(info) {
this._initSlottedInput();
}.bind(this));
this._slotChangeHandler = this._initSlottedInput.bind(this);
this.$.content.addEventListener('slotchange', this._slotChangeHandler);
},

detached: function() {
Polymer.dom(this).unobserveNodes(this._observer);
this._observer = null;
this.$.content.removeEventListener('slotchange', this._slotChangeHandler);
this._slotChangeHandler = null;
},

_initSlottedInput: function() {
Expand Down
15 changes: 9 additions & 6 deletions test/iron-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,16 @@
var ironInput = fixture('basic');
var input = ironInput.querySelector('input');

ironInput.addEventListener('bind-value-changed', function(value) {
assert.equal(input.value, ironInput.bindValue, 'input value equals to iron-input bindValue');
done();
});
// avoid `bind-value-changed` that's fired on initialization
Polymer.Base.async(function() {
ironInput.addEventListener('bind-value-changed', function(value) {
assert.equal(input.value, ironInput.bindValue, 'input value equals to iron-input bindValue');
done();
});

input.value = 'foo';
ironInput._onInput();
input.value = 'foo';
ironInput._onInput();
}, 1);
});

test('default bindValue sets value', function() {
Expand Down