updateValue(event, value, persist) {
		const previousValue = persist ? value : this.state.previousValue;
		const newValue = typeof value === 'object' ? value.name : value;
		this.setState({
			// setting the filtered value so it needs to be actual value
			value: newValue,
		});
		if (persist) {
			let enumValue = value;
			if (this.props.multiSection) {
				const groups = this.props.titleMap;
				for (let sectionIndex = 0; sectionIndex < groups.length; sectionIndex += 1) {
					const itemObj = groups[sectionIndex].suggestions.find(item => item.name === value);
					if (itemObj) {
						enumValue = itemObj;
						break;
					}
				}
			}
			const selectedEnumValue = get(enumValue, 'value');

			if (selectedEnumValue || !this.props.restricted) {
				this.props.onChange(event, { value: selectedEnumValue || value });
				this.setState({
					previousValue: previousValue.name,
				});
			} else {
				this.resetValue();
			}
		} else if (this.props.onLiveChange) {
			this.props.onLiveChange(event, value);
		}
	}
/**
	 * Set a value.
	 * This new value can be persisted, or not. If not, it enables the ESC key to reset the value
	 * @param event The change event
	 * @param value The new value
	 * @param persist Value will be persisted if true
	 */
Set a value.
This new value can be persisted, or not. If not, it enables the ESC key to reset the value
@param event The change event
@param value The new value
@param persist Value will be persisted if true
Set a value . This new value can be persisted or not . If not it enables the ESC key to reset the value @param event The change event @param value The new value @param persist Value will be persisted if true
updateValue(event, value, persist) {
		const previousValue = persist ? value : this.state.previousValue;
		const newValue = typeof value === 'object' ? value.name : value;
		this.setState({
			value: newValue,
		});
		if (persist) {
			let enumValue = value;
			if (this.props.multiSection) {
				const groups = this.props.titleMap;
				for (let sectionIndex = 0; sectionIndex < groups.length; sectionIndex += 1) {
					const itemObj = groups[sectionIndex].suggestions.find(item => item.name === value);
					if (itemObj) {
						enumValue = itemObj;
						break;
					}
				}
			}
			const selectedEnumValue = get(enumValue, 'value');
			if (selectedEnumValue || !this.props.restricted) {
				this.props.onChange(event, { value: selectedEnumValue || value });
				this.setState({
					previousValue: previousValue.name,
				});
			} else {
				this.resetValue();
			}
		} else if (this.props.onLiveChange) {
			this.props.onLiveChange(event, value);
		}
	}
updateValue ( event , value , persist ) { const previousValue = persist ? value : this . state . previousValue ; const newValue = typeof value === 'object' ? value . name : value ; this . setState ( { value : newValue , } ) ; if ( persist ) { let enumValue = value ; if ( this . props . multiSection ) { const groups = this . props . titleMap ; for ( let sectionIndex = 0 ; sectionIndex < groups . length ; sectionIndex += 1 ) { const itemObj = groups [ sectionIndex ] . suggestions . find ( item => item . name === value ) ; if ( itemObj ) { enumValue = itemObj ; break ; } } } const selectedEnumValue = get ( enumValue , 'value' ) ; if ( selectedEnumValue || ! this . props . restricted ) { this . props . onChange ( event , { value : selectedEnumValue || value } ) ; this . setState ( { previousValue : previousValue . name , } ) ; } else { this . resetValue ( ) ; } } else if ( this . props . onLiveChange ) { this . props . onLiveChange ( event , value ) ; } }
Set a value.
Set a value .
// setting the filtered value so it needs to be actual value