Skip to content

Commit 72ac2f0

Browse files
committed
FIx language selector
1 parent 1dd0b51 commit 72ac2f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mystbin/frontend/components/EditorTabs.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import DropdownItem from "react-bootstrap/DropdownItem";
1414
import React from "react";
1515
import InsertPhotoIcon from "@material-ui/icons/InsertPhoto";
1616
import SettingsIcon from '@material-ui/icons/Settings';
17+
import {language} from "@hapi/accept";
1718

1819
const languages = {
1920
py: "python",
@@ -199,7 +200,7 @@ export default function EditorTabs({
199200
</Button>
200201
{langDropDown ? (
201202
<div className={styles.langParent}>
202-
<Dropdown className={styles.dropDown} autoClose>
203+
<Dropdown className={styles.dropDown} autoClose={'outside'}>
203204
{Object.keys(languages).map((v, index) => {
204205
if (i !== currTab) {
205206
return <></>;
@@ -213,7 +214,7 @@ export default function EditorTabs({
213214
}}
214215
onClick={() => {
215216
setLangDropDown(false);
216-
setDropLang(v);
217+
setDropLang(getLanguage(v));
217218
}}
218219
>
219220
{v}

0 commit comments

Comments
 (0)