Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,27 @@ function TextEditor({
markdown,
onChange,
readOnly,
noTypeInference,
}: {
editorId: string
value: unknown
displayValue: string
markdown?: boolean
onChange: (value: unknown) => void
readOnly?: boolean
noTypeInference?: boolean
}) {
// Auto-infer native types from typed text so number / boolean values
// stop getting stored as strings. Anything that doesn't look exactly
// like a clean number or boolean literal stays a string — see
// inferPrimitiveFromText for the precise rules.
//
// When noTypeInference is true (Text or Markdown view mode), skip
// inference and store the raw string — the user explicitly chose a text
// view so values like "False" or "42" should remain strings.
const handleChange = useCallback(
(next: string) => onChange(inferPrimitiveFromText(next)),
[onChange],
(next: string) => onChange(noTypeInference ? next : inferPrimitiveFromText(next)),
[onChange, noTypeInference],
)

return (
Expand Down Expand Up @@ -250,6 +256,7 @@ export function TestcaseDrillInFieldRenderer({
markdown
onChange={onChange}
readOnly={!editable}
noTypeInference
/>
)
}
Expand All @@ -262,6 +269,7 @@ export function TestcaseDrillInFieldRenderer({
displayValue={displayValue}
onChange={onChange}
readOnly={!editable}
noTypeInference
/>
)
}
Expand Down
Loading