diff --git a/components/checkbox/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/checkbox/__tests__/__snapshots__/demo-extend.test.ts.snap index 3be836d953..c54a484996 100644 --- a/components/checkbox/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/checkbox/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -165,6 +165,75 @@ Array [ exports[`renders components/checkbox/demo/controller.tsx extend context correctly 2`] = `[]`; +exports[`renders components/checkbox/demo/custom-line-width.tsx extend context correctly 1`] = ` +Array [ + , + , + , + , +] +`; + +exports[`renders components/checkbox/demo/custom-line-width.tsx extend context correctly 2`] = `[]`; + exports[`renders components/checkbox/demo/debug-disable-popover.tsx extend context correctly 1`] = `
+ + + + + , + , + , + , +] +`; + exports[`renders components/checkbox/demo/debug-disable-popover.tsx correctly 1`] = `
( + <> + + + + + + + +); + +export default App; diff --git a/components/checkbox/index.en-US.md b/components/checkbox/index.en-US.md index a68efc757a..867068673a 100644 --- a/components/checkbox/index.en-US.md +++ b/components/checkbox/index.en-US.md @@ -26,6 +26,7 @@ Checkbox component. Use with Grid Same line Disabled to show Tooltip +customize lineWidth ## API diff --git a/components/checkbox/index.zh-CN.md b/components/checkbox/index.zh-CN.md index 0ee3ddd08d..6f3caf508f 100644 --- a/components/checkbox/index.zh-CN.md +++ b/components/checkbox/index.zh-CN.md @@ -27,6 +27,7 @@ demo: 布局 同行布局 禁用下的 Tooltip +自定义 lineWidth ## API diff --git a/components/checkbox/style/index.ts b/components/checkbox/style/index.ts index 1695f774db..ae4a2dfc7c 100644 --- a/components/checkbox/style/index.ts +++ b/components/checkbox/style/index.ts @@ -96,9 +96,6 @@ export const genCheckboxStyle: GenerateStyle = (token) => { // Wrapper > Checkbox > inner [`${checkboxCls}-inner`]: { boxSizing: 'border-box', - position: 'relative', - top: 0, - insetInlineStart: 0, display: 'block', width: token.checkboxSize, height: token.checkboxSize, @@ -113,7 +110,7 @@ export const genCheckboxStyle: GenerateStyle = (token) => { boxSizing: 'border-box', position: 'absolute', top: '50%', - insetInlineStart: '21.5%', + insetInlineStart: '25%', display: 'table', width: token.calc(token.checkboxSize).div(14).mul(5).equal(), height: token.calc(token.checkboxSize).div(14).mul(8).equal(),