@rmwc/textfield
Advanced tools
Comparing version 3.0.9 to 3.0.10
@@ -49,2 +49,3 @@ import { SimpleTagPropsT } from '@rmwc/base'; | ||
outline_: null | any; | ||
valueNeedsUpdate: boolean; | ||
constructor(props: TextFieldPropsT); | ||
@@ -51,0 +52,0 @@ getDefaultFoundation(): any; |
23
index.js
@@ -176,2 +176,8 @@ 'use strict'; | ||
Object.defineProperty(_this4, 'valueNeedsUpdate', { | ||
enumerable: true, | ||
writable: true, | ||
value: false | ||
}); | ||
_this4.generatedId = (0, _base.randomId)('text-field'); | ||
@@ -349,4 +355,7 @@ _this4.createClassList('root_'); | ||
value: function sync(props) { | ||
if (props.value !== undefined && props.value !== this.foundation_.getValue()) { | ||
// Bug #362 | ||
// see comments below in render function | ||
if (this.valueNeedsUpdate) { | ||
this.foundation_.setValue(props.value); | ||
this.valueNeedsUpdate = false; | ||
} | ||
@@ -378,2 +387,14 @@ } | ||
// Fixes bug #362 | ||
// MDC breaks Reacts unidirectional data flow... | ||
// we cant set the value on render, but we need to | ||
// to create the side effects for the UI when we dynamically update the field | ||
// Flag that it needs to be set so that we can call the foundation | ||
// on componentDidUpdate | ||
if (this.props.value !== undefined && this.props.value !== this.foundation_.getValue()) { | ||
this.valueNeedsUpdate = true; | ||
} | ||
var tagProps = Object.assign({ | ||
@@ -380,0 +401,0 @@ disabled: disabled, |
{ | ||
"name": "@rmwc/textfield", | ||
"version": "3.0.9", | ||
"version": "3.0.10", | ||
"description": "RMWC TextField component", | ||
@@ -30,8 +30,8 @@ "main": "index.js", | ||
"@material/textfield": "~0.40.0", | ||
"@rmwc/base": "^3.0.9", | ||
"@rmwc/floating-label": "^3.0.9", | ||
"@rmwc/icon": "^3.0.9", | ||
"@rmwc/line-ripple": "^3.0.9", | ||
"@rmwc/notched-outline": "^3.0.9" | ||
"@rmwc/base": "^3.0.10", | ||
"@rmwc/floating-label": "^3.0.10", | ||
"@rmwc/icon": "^3.0.10", | ||
"@rmwc/line-ripple": "^3.0.10", | ||
"@rmwc/notched-outline": "^3.0.10" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
56669
1044
Updated@rmwc/base@^3.0.10
Updated@rmwc/floating-label@^3.0.10
Updated@rmwc/icon@^3.0.10
Updated@rmwc/line-ripple@^3.0.10