Skip to content

Commit

Permalink
Merge pull request #976 from alibaba/fix-atag-input-val
Browse files Browse the repository at this point in the history
fix: atag input value in iOS
  • Loading branch information
yuanyan authored Mar 13, 2019
2 parents ab4b9db + a33adaf commit 398642f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/atag/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atag",
"version": "0.1.42",
"version": "0.1.45",
"description": "A UI Web Components Library",
"main": "dist/atag.js",
"scripts": {
Expand Down
9 changes: 7 additions & 2 deletions packages/atag/src/components/input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ export default class Input extends PolymerElement {

/**
* Sync a-input value to real input value.
* @NOTE: If assign value to DOM Element directly, some iOS version of
* webview can not handle properly and to determintae insert composition process.
* To fix this, should judge value is equal first.
* @private
*/
_observeValue() {
this.$.input.value = this.value;
_observeValue(newValue) {
if (this.$.input.value !== newValue) {
this.$.input.value = newValue;
}
}

/**
Expand Down

0 comments on commit 398642f

Please sign in to comment.