Ivan Asmer il y a 4 ans
Parent
commit
96f013aee0
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/App.js

+ 2 - 1
src/App.js

@@ -409,6 +409,7 @@ const MDEdit = ({children, field, onChange, ...props}) => {
                             placeholder={field.name} 
                             value={children} 
                             onChange={onChange} 
+                            onLoad = {e => e.getSession().setUseWrapMode(true)}
                             {...props}
                         />
                         <div style={{maxWidth: '50%', height: '400px', overflow: 'auto'}}>
@@ -508,7 +509,7 @@ const defaultAdminOptions =
                                                 <textarea placeholder={field.name} value={children} {...props}/> :
                                                 <><input placeholder={field.name} value={children} {...props} />
                                                    <button onClick={() => props.onChange && props.onChange((children || '') + '\n')}>V</button> </> ),
-                Int: ({children, ...props}) => <input type='number' value={children} {...props}/>,
+                Int: ({children, onChange, ...props}) => <input type='number' value={children} onChange={e => onChange(+e.target.value)} {...props}/>,
                 Float: ({children, ...props}) => <input type='number' value={children}  {...props} onChange={(e) => props.onChange(+e.target.value)}/>,
                 Object: ({children, options, model, models, ...props}) => {
                     return model.fields[0].name === '_id' ? <ObjectShortEdit children={children} options={options} model={model} {...props}/> : <EditForm model={model} models={models} record={children} options={options} />