fix(Table): Fix checkbox does not work when Table Filter value is number type on next branch (#3053)

pull/3067/head
dogrod 4 years ago committed by GitHub
parent 1e1a1bd8a8
commit 9de1b594b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,7 +173,7 @@ export default defineComponent({
[`${dropdownPrefixCls}-submenu-contain-selected`]: containSelected,
});
return (
<SubMenu title={item.text} popupClassName={subMenuCls} key={item.value.toString()}>
<SubMenu title={item.text} popupClassName={subMenuCls} key={item.value}>
{this.renderMenus(item.children)}
</SubMenu>
);
@ -217,13 +217,10 @@ export default defineComponent({
const { sSelectedKeys: selectedKeys } = this;
const multiple = 'filterMultiple' in column ? column.filterMultiple : true;
// We still need trade key as string since Menu render need string
// const internalSelectedKeys = (selectedKeys || []).map(key => key.toString());
const input = multiple ? (
<Checkbox checked={selectedKeys && selectedKeys.indexOf(item.value.toString()) >= 0} />
<Checkbox checked={selectedKeys && selectedKeys.indexOf(item.value) >= 0} />
) : (
<Radio checked={selectedKeys && selectedKeys.indexOf(item.value.toString()) >= 0} />
<Radio checked={selectedKeys && selectedKeys.indexOf(item.value) >= 0} />
);
return (
@ -270,7 +267,7 @@ export default defineComponent({
class={dropdownMenuClass}
onSelect={this.setSelectedKeys}
onDeselect={this.setSelectedKeys}
selectedKeys={originSelectedKeys && originSelectedKeys.map(val => val.toString())}
selectedKeys={originSelectedKeys && originSelectedKeys.map(val => val)}
getPopupContainer={getPopupContainer}
children={this.renderMenus(column.filters)}
></Menu>

Loading…
Cancel
Save