diff --git a/packages/component/src/ui/button/dropdown.tsx b/packages/component/src/ui/button/dropdown.tsx index 005b7194bf..002a69cb79 100644 --- a/packages/component/src/ui/button/dropdown.tsx +++ b/packages/component/src/ui/button/dropdown.tsx @@ -8,14 +8,14 @@ import { import * as styles from './styles.css'; type DropdownButtonProps = { - onClickDropDown?: MouseEventHandler; + onClickDropDown?: MouseEventHandler; } & ButtonHTMLAttributes; export const DropdownButton = forwardRef< HTMLButtonElement, DropdownButtonProps >(({ onClickDropDown, children, ...props }, ref) => { - const handleClickDropDown: MouseEventHandler = e => { + const handleClickDropDown: MouseEventHandler = e => { e.stopPropagation(); onClickDropDown?.(e); }; @@ -23,12 +23,9 @@ export const DropdownButton = forwardRef< ); }); diff --git a/packages/component/src/ui/button/styles.css.ts b/packages/component/src/ui/button/styles.css.ts index d4da59a1ab..32ee4a0ff9 100644 --- a/packages/component/src/ui/button/styles.css.ts +++ b/packages/component/src/ui/button/styles.css.ts @@ -5,7 +5,8 @@ export const dropdownBtn = style({ alignItems: 'center', justifyContent: 'center', padding: '0 10px', - gap: '4px', + // fix dropdown button click area + paddingRight: 0, color: 'var(--affine-text-primary-color)', fontWeight: 600, background: 'var(--affine-button-gray-color)', @@ -28,6 +29,19 @@ export const divider = style({ width: '0.5px', height: '16px', background: 'var(--affine-border-color)', + // fix dropdown button click area + margin: '0 4px', + marginRight: 0, +}); + +export const dropdownWrapper = style({ + width: '100%', + height: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + paddingLeft: '4px', + paddingRight: '10px', }); export const icon = style({