Skip to content

Commit

Permalink
Merge branch 'main' into refactor/491-remove-golden-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikbossart authored Sep 11, 2023
2 parents 02a80ec + 0e9592f commit 765e3a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/dm-core-plugins/src/table/TableRow/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,18 @@ export function TableRow(props: TTableRow) {
type={attributeType}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
let newValue: string | number | boolean = event.target.value
if (attributeType === 'number') newValue = Number(newValue)
if (attributeType === 'number') {
const numberArray = Array.from(newValue)
if (
!numberArray.includes('.') &&
numberArray.length > 1 &&
Number(numberArray.at(0)) === 0
) {
newValue = newValue.slice(1)
event.target.value = newValue
}
newValue = Number(newValue)
}
updateItem(index, attribute, newValue)
}}
/>
Expand Down

0 comments on commit 765e3a0

Please sign in to comment.