Skip to content

Commit

Permalink
fix(aurora): add maxLength support to NumberWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmiguel committed Dec 17, 2024
1 parent 50f4ec1 commit 852ee65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/aurora-theme/Widgets/NumberWidget/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from "react"
import TextWidget from "../TextWidget"

const NumberWidget = ({ min = "0", max, ...rest }) => {
const NumberWidget = ({ min = "0", max, maxLength, ...rest }) => {
const handleChange = (value) => {
if (maxLength && value.length > maxLength) {
value = value.slice(0, maxLength)
}
rest.onChange(value);
}

Expand Down

0 comments on commit 852ee65

Please sign in to comment.