Skip to content

Commit 2242395

Browse files
authored
Input fixes (#168)
1 parent eed9158 commit 2242395

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Lumi/Components/Form.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ inputBox inputProps = formBuilder_ \{ readonly } s onChange ->
345345
else Input.input inputProps
346346
{ value = s
347347
, onChange = capture targetValue (traverse_ onChange)
348-
, style = R.css { width: "100%" }
348+
, style = R.css { width: "100%" } <> inputProps.style
349349
}
350350

351351
-- | A simple text box makes a `FormBuilder` for strings
@@ -451,7 +451,7 @@ labeledCheckbox label =
451451
}
452452
where
453453
lumiAlignToInput = element (R.unsafeCreateDOMComponent "lumi-align-to-input")
454-
454+
455455
-- | A form that edits an optional structure represented by group of radio
456456
-- | buttons, visually oriented in either horizontal or vertical fashion.
457457
-- |

src/Lumi/Components/Input.purs

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ type InputProps =
9797
, disabled :: Boolean
9898
, max :: Nullable Number
9999
, min :: Nullable Number
100+
, maxLength :: Nullable Int
101+
, minLength :: Nullable Int
100102
, step :: Nullable InputStep
101103
, name :: String
102104
, onBlur :: Nullable EventHandler
@@ -133,6 +135,8 @@ input = makeStateless component $ element lumiInputElement <<< mapProps
133135
, indeterminate: props.checked == Indeterminate
134136
, max: props.max
135137
, min: props.min
138+
, maxLength: props.maxLength
139+
, minLength: props.minLength
136140
, step: toNullable $ map displayStep $ toMaybe props.step
137141
, name: props.name
138142
, onBlur: props.onBlur
@@ -156,6 +160,8 @@ text_ =
156160
, disabled: false
157161
, max: toNullable Nothing
158162
, min: toNullable Nothing
163+
, maxLength: toNullable Nothing
164+
, minLength: toNullable Nothing
159165
, step: toNullable Nothing
160166
, name: ""
161167
, onBlur: toNullable Nothing

0 commit comments

Comments
 (0)