parent
566fae9d58
commit
7f5ddff568
|
@ -41,7 +41,7 @@ class NumberInput extends Component {
|
||||||
componentDidUpdate(prevProps, prevState) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
const { value } = this.props;
|
const { value } = this.props;
|
||||||
|
|
||||||
if (value !== prevProps.value && !this.state.isFocused) {
|
if (!isNaN(value) && value !== prevProps.value && !this.state.isFocused) {
|
||||||
this.setState({
|
this.setState({
|
||||||
value: value == null ? '' : value.toString()
|
value: value == null ? '' : value.toString()
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ export const CHECK = 'check';
|
||||||
export const DEVICE = 'device';
|
export const DEVICE = 'device';
|
||||||
export const KEY_VALUE_LIST = 'keyValueList';
|
export const KEY_VALUE_LIST = 'keyValueList';
|
||||||
export const MONITOR_EPISODES_SELECT = 'monitorEpisodesSelect';
|
export const MONITOR_EPISODES_SELECT = 'monitorEpisodesSelect';
|
||||||
|
export const FLOAT = 'float';
|
||||||
export const NUMBER = 'number';
|
export const NUMBER = 'number';
|
||||||
export const OAUTH = 'oauth';
|
export const OAUTH = 'oauth';
|
||||||
export const PASSWORD = 'password';
|
export const PASSWORD = 'password';
|
||||||
|
@ -30,6 +31,7 @@ export const all = [
|
||||||
DEVICE,
|
DEVICE,
|
||||||
KEY_VALUE_LIST,
|
KEY_VALUE_LIST,
|
||||||
MONITOR_EPISODES_SELECT,
|
MONITOR_EPISODES_SELECT,
|
||||||
|
FLOAT,
|
||||||
NUMBER,
|
NUMBER,
|
||||||
OAUTH,
|
OAUTH,
|
||||||
PASSWORD,
|
PASSWORD,
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace Sonarr.Http.ClientSchema
|
||||||
public string Hidden { get; set; }
|
public string Hidden { get; set; }
|
||||||
public PrivacyLevel Privacy { get; set; }
|
public PrivacyLevel Privacy { get; set; }
|
||||||
public string Placeholder { get; set; }
|
public string Placeholder { get; set; }
|
||||||
|
public bool IsFloat { get; set; }
|
||||||
|
|
||||||
public Field Clone()
|
public Field Clone()
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,6 +140,11 @@ namespace Sonarr.Http.ClientSchema
|
||||||
field.Hidden = fieldAttribute.Hidden.ToString().FirstCharToLower();
|
field.Hidden = fieldAttribute.Hidden.ToString().FirstCharToLower();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fieldAttribute.Type is FieldType.Number && propertyInfo.PropertyType == typeof(double))
|
||||||
|
{
|
||||||
|
field.IsFloat = true;
|
||||||
|
}
|
||||||
|
|
||||||
var valueConverter = GetValueConverter(propertyInfo.PropertyType);
|
var valueConverter = GetValueConverter(propertyInfo.PropertyType);
|
||||||
|
|
||||||
result.Add(new FieldMapping
|
result.Add(new FieldMapping
|
||||||
|
|
Loading…
Reference in New Issue