Comparing version 0.2.28 to 0.2.29
@@ -78,4 +78,5 @@ 'use strict'; | ||
getInitialState: function getInitialState() { | ||
var selectedChoices = this.props.config.fieldSelectedReplaceChoices(this.props.field); | ||
var replaceChoices = this.props.config.fieldReplaceChoices(this.props.field); | ||
var translator = TagTranslator(replaceChoices, this.props.config.humanize); | ||
var translator = TagTranslator(selectedChoices.concat(replaceChoices), this.props.config.humanize); | ||
@@ -92,9 +93,9 @@ return { | ||
componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | ||
var selectedChoices = this.props.config.fieldSelectedReplaceChoices(this.props.field); | ||
var replaceChoices = this.props.config.fieldReplaceChoices(nextProps.field); | ||
var nextState = { | ||
replaceChoices: replaceChoices | ||
replaceChoices: replaceChoices, | ||
translator: TagTranslator(selectedChoices.concat(replaceChoices), this.props.config.humanize) | ||
}; | ||
this.state.translator.addChoices(replaceChoices); | ||
if (this.state.value !== nextProps.field.value && nextProps.field.value) { | ||
@@ -101,0 +102,0 @@ nextState.value = nextProps.field.value; |
@@ -775,2 +775,10 @@ // # default-config | ||
// The active replace labels could be unavilable in the current list of | ||
// replace choices. This provides the currently used replace labels in | ||
// that case. | ||
fieldSelectedReplaceChoices: function fieldSelectedReplaceChoices(field) { | ||
return config.normalizeChoices(field.selectedReplaceChoices); | ||
}, | ||
// Get a label for a field. | ||
@@ -777,0 +785,0 @@ fieldLabel: function fieldLabel(field) { |
{ | ||
"name": "formatic", | ||
"version": "0.2.28", | ||
"version": "0.2.29", | ||
"description": "Automatic, pluggable form generation", | ||
@@ -5,0 +5,0 @@ "main": "./build/lib/formatic", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
742537
10072