Skip to content

Commit da0bda5

Browse files
author
Robert Gregg
committed
fix(EditorInput.js): Refactored the argument to compare a number with a number
The value in a gtfs option is a string, so converting to a number to make the comparrisson. #656
1 parent ec1c526 commit da0bda5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/editor/components/EditorInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ export default class EditorInput extends React.Component<Props> {
128128
const routeTypes = [
129129
{
130130
label: 'Standard',
131-
options: options.filter(opt => opt.value < 100).map(toOption)
131+
options: options.filter(opt => parseInt(opt.value) < 100).map(toOption)
132132
},
133133
{
134134
label: 'Extended',
135-
options: options.filter(opt => opt.value >= 100).map(toOption)
135+
options: options.filter(opt => parseInt(opt.value) >= 100).map(toOption)
136136
}
137137
]
138138
return routeTypes.map(({label, options}) => (

lib/types/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ export type GtfsSpecField = {
578578
helpContent?: string,
579579
inputType: InputType,
580580
name: string,
581-
options?: Array<{text: string, value: string | number}>,
581+
options?: Array<{text: string, value: string}>,
582582
placeholder?: string,
583583
required: boolean
584584
}

0 commit comments

Comments
 (0)