react-component / menu

React Menu
https://menu.react-component.now.sh/
MIT License
682 stars 248 forks source link

rc-menu doesn't work well with checkbox in menu-item #703

Open jingchen233 opened 7 months ago

jingchen233 commented 7 months ago

code blob like below:

const menu = [ {key: '0', label: 'Item 1flshgslhgslhglshg', disabled: true}, {key: '1', label: 'Item 2', checked: true}, {key: '2', label: 'Item 3'}];

<Menu multiple={true} selectedKeys={selectedKeys} onSelect={onMenuSelect} onDeselect={onMenuDeSelect}

{ menu.map((item) => { return <checkbox checked={item?.checked || false} disabled={item.disabled} label={item.label} /> }

problems: when I click checkbox, it will call both onSelect and onDeselect.