Skip to content

Commit a00d751

Browse files
JonathanTGoldJonathanTGold
andauthored
fix(FEC-13897): Close captions order alphabetically works only for labels that starts with capital letter. (#882)
### Description of the Changes Close captions order alphabetically works only for labels that starts with capital letter. #### Resolves FEC-13897 Co-authored-by: JonathanTGold <jonathan.gold@86@gmail.com>
1 parent 50bfeab commit a00d751

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/captions-menu/captions-menu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ class CaptionsMenu extends Component<any, any> {
118118
active: t.active,
119119
value: t
120120
}))
121-
.sort((a, b) => a.label > b.label || a.label === 'Off' ? 1 : -1);
121+
.map(t => ({
122+
...t,
123+
label: t.label.charAt(0).toUpperCase() + t.label.slice(1)
124+
}))
125+
.sort((a, b) => (a.label > b.label || a.label === 'Off' ? 1 : -1));
122126

123127
if (props.showAdvancedCaptionsMenu) {
124128
textOptions.push({label: props.advancedCaptionsSettingsText, value: props.advancedCaptionsSettingsText, active: false});

0 commit comments

Comments
 (0)