Skip to content

Commit 31f3d65

Browse files
committed
sync back inline input value if initial data is undefined
1 parent 172e397 commit 31f3d65

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/directive.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ DirProto.update = function (value, init) {
127127
this._update(
128128
this.filters
129129
? this.applyFilters(value)
130-
: value
130+
: value,
131+
init
131132
)
132133
}
133134
}

src/directives/model.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ module.exports = {
118118
)
119119
},
120120

121-
update: function (value) {
121+
update: function (value, init) {
122122
/* jshint eqeqeq: false */
123+
// sync back inline value if initial data is undefined
124+
if (init && value === undefined) {
125+
return this._set()
126+
}
123127
if (this.lock) return
124128
var el = this.el
125129
if (el.tagName === 'SELECT') { // select dropdown

0 commit comments

Comments
 (0)