Browse Source

fix: Steps keyboard switch (#43644)

pull/43646/head
二货爱吃白萝卜 1 year ago
committed by GitHub
parent
commit
04e729d14a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      components/steps/style/index.tsx
  2. 2
      package.json

13
components/steps/style/index.tsx

@ -1,6 +1,6 @@
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import type { CSSProperties } from 'react'; import type { CSSProperties } from 'react';
import { resetComponent } from '../../style'; import { genFocusOutline, resetComponent } from '../../style';
import type { FullToken, GenerateStyle } from '../../theme/internal'; import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook, mergeToken } from '../../theme/internal'; import { genComponentStyleHook, mergeToken } from '../../theme/internal';
import genStepsCustomIconStyle from './custom-icon'; import genStepsCustomIconStyle from './custom-icon';
@ -171,6 +171,7 @@ const genStepsItemStatusStyle = (status: StepItemStatusEnum, token: StepsToken):
const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => { const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
const { componentCls, motionDurationSlow } = token; const { componentCls, motionDurationSlow } = token;
const stepsItemCls = `${componentCls}-item`; // .ant-steps-item const stepsItemCls = `${componentCls}-item`; // .ant-steps-item
const stepItemIconCls = `${stepsItemCls}-icon`;
return { return {
[stepsItemCls]: { [stepsItemCls]: {
@ -189,12 +190,18 @@ const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
}, },
[`${stepsItemCls}-container`]: { [`${stepsItemCls}-container`]: {
outline: 'none', outline: 'none',
[`&:focus-visible`]: {
[stepItemIconCls]: {
...genFocusOutline(token),
},
},
}, },
[`${stepsItemCls}-icon, ${stepsItemCls}-content`]: { [`${stepItemIconCls}, ${stepsItemCls}-content`]: {
display: 'inline-block', display: 'inline-block',
verticalAlign: 'top', verticalAlign: 'top',
}, },
[`${stepsItemCls}-icon`]: { [stepItemIconCls]: {
width: token.iconSize, width: token.iconSize,
height: token.iconSize, height: token.iconSize,
marginTop: 0, marginTop: 0,

2
package.json

@ -144,7 +144,7 @@
"rc-segmented": "~2.2.0", "rc-segmented": "~2.2.0",
"rc-select": "~14.5.0", "rc-select": "~14.5.0",
"rc-slider": "~10.1.0", "rc-slider": "~10.1.0",
"rc-steps": "~6.0.0", "rc-steps": "~6.0.1",
"rc-switch": "~4.1.0", "rc-switch": "~4.1.0",
"rc-table": "~7.32.1", "rc-table": "~7.32.1",
"rc-tabs": "~12.9.0", "rc-tabs": "~12.9.0",

Loading…
Cancel
Save