mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-05 18:01:39 -05:00
Merge pull request #82 from cdmbase/master
Fix for empty `input.value` issue and form prefilled issues
This commit is contained in:
commit
f7a32530a4
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ export class Field extends React.Component {
|
|||
triggerUpdate() {
|
||||
// Trigger an onChange on inital load, to support browser prefilled values.
|
||||
const { onChange } = this.props;
|
||||
if (this.input) {
|
||||
if (this.input && this.input.value) {
|
||||
onChange({ target: { value: this.input.value } });
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ export class Field extends React.Component {
|
|||
componentDidUpdate(prevProps) {
|
||||
// Re-mount component so that we don't expose browser prefilled passwords if the component was
|
||||
// a password before and now something else.
|
||||
if (prevProps.formState !== this.props.formState) {
|
||||
if (prevProps.id !== this.props.id) {
|
||||
this.setState({mount: false});
|
||||
}
|
||||
else if (!this.state.mount) {
|
||||
|
|
Loading…
Add table
Reference in a new issue