Fix type check + moved width and height to rect property
This commit is contained in:
parent
6ac76f6619
commit
05622c3a64
3 changed files with 8 additions and 5 deletions
|
@ -42,7 +42,7 @@ export class Properties extends React.Component<IPropertiesProps, IPropertiesSta
|
|||
groupInput: React.ReactNode[]
|
||||
) => {
|
||||
const id = `property-${key}`;
|
||||
const type = typeof value === 'number' ? 'number' : 'text';
|
||||
const type = isNaN(Number(value)) ? 'text' : 'number';
|
||||
const isDisabled = key === 'id'; // hardcoded
|
||||
groupInput.push(
|
||||
<div key={id} className='mt-4'>
|
||||
|
@ -52,8 +52,7 @@ export class Properties extends React.Component<IPropertiesProps, IPropertiesSta
|
|||
bg-slate-600 border-2 border-slate-600 rounded-lg shadow-sm placeholder-slate-400
|
||||
focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500
|
||||
disabled:bg-slate-700 disabled:text-slate-400 disabled:border-slate-700 disabled:shadow-none
|
||||
invalid:border-pink-500 invalid:text-pink-600
|
||||
focus:invalid:border-pink-500 focus:invalid:ring-pink-5002'
|
||||
'
|
||||
type={type}
|
||||
id={id}
|
||||
value={value}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue