@gemsorg/modules
Advanced tools
Comparing version 0.1.24 to 0.1.25
{ | ||
"name": "@gemsorg/modules", | ||
"version": "0.1.24", | ||
"version": "0.1.25", | ||
"description": "gems modules", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "93425338e881cd35b054dbd9e72c3f0939029759" | ||
"gitHead": "867ad3900f0183ccc6fa5d980994283e3c9e036b" | ||
} |
@@ -29,3 +29,3 @@ import React, { Component } from 'react'; | ||
inputType: 'text', | ||
value: '', | ||
value: undefined, | ||
initial: null, | ||
@@ -40,2 +40,25 @@ label: null, | ||
componentDidMount() { | ||
const { name, value, initial, onChange } = this.props; | ||
if (initial && value === undefined) { | ||
onChange(name, initial); | ||
} | ||
} | ||
componentDidUpdate(prevProps) { | ||
const { name, value, initial, onChange } = this.props; | ||
const { touched } = this.state; | ||
if ( | ||
!touched && | ||
value === undefined && | ||
prevProps.initial !== initial && | ||
initial | ||
) { | ||
onChange(name, initial); | ||
} | ||
} | ||
handleChange = ({ target }) => { | ||
@@ -42,0 +65,0 @@ const { name, onChange } = this.props; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
278437
7440