Skip to content

Commit b78ab9e

Browse files
Fix form tab (#4066)
1 parent 938bd73 commit b78ab9e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

site/src/components/FormFooter/FormFooter.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const useStyles = makeStyles((theme) => ({
1818
footer: {
1919
display: "flex",
2020
flex: "0",
21-
flexDirection: "row",
21+
// The first button is the submit so it is the first element to be focused
22+
// on tab so we use row-reverse to display it on the right
23+
flexDirection: "row-reverse",
2224
gap: theme.spacing(1.5),
2325
alignItems: "center",
2426
marginTop: theme.spacing(3),
@@ -36,10 +38,8 @@ export const FormFooter: FC<React.PropsWithChildren<FormFooterProps>> = ({
3638
const styles = useStyles()
3739
return (
3840
<div className={styles.footer}>
39-
<Button type="button" className={styles.button} onClick={onCancel} variant="outlined">
40-
{Language.cancelLabel}
41-
</Button>
4241
<LoadingButton
42+
tabIndex={0}
4343
loading={isLoading}
4444
className={styles.button}
4545
variant="contained"
@@ -48,6 +48,15 @@ export const FormFooter: FC<React.PropsWithChildren<FormFooterProps>> = ({
4848
>
4949
{submitLabel}
5050
</LoadingButton>
51+
<Button
52+
type="button"
53+
className={styles.button}
54+
onClick={onCancel}
55+
variant="outlined"
56+
tabIndex={0}
57+
>
58+
{Language.cancelLabel}
59+
</Button>
5160
</div>
5261
)
5362
}

site/src/theme/palettes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const darkPalette: PaletteOptions = {
1414
type: "dark",
1515
primary: {
1616
main: colors.blue[7],
17-
contrastText: colors.gray[4],
17+
contrastText: colors.blue[1],
1818
light: colors.blue[6],
1919
dark: colors.blue[9],
2020
},

0 commit comments

Comments
 (0)