From 38fed479d67115d324bdef9caecdf8fba55a0876 Mon Sep 17 00:00:00 2001 From: bindoon Date: Tue, 8 Oct 2019 18:40:51 +0800 Subject: [PATCH] fix(Select): add api menuProps for menu. close #1141 --- src/select/base.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/select/base.jsx b/src/select/base.jsx index 7cdaf2d6b2..20bdfcf2a8 100644 --- a/src/select/base.jsx +++ b/src/select/base.jsx @@ -95,6 +95,10 @@ export default class Base extends React.Component { * 自定义弹层的内容 */ popupContent: PropTypes.node, + /** + * 添加到菜单上的属性 + */ + menuProps: PropTypes.object, /** * 是否使用本地过滤,在数据源为远程的时候需要关闭此项 */ @@ -396,6 +400,7 @@ export default class Base extends React.Component { locale, notFoundContent, useVirtual, + menuProps, } = this.props; const { dataSource, highlightKey } = this.state; const value = this.state.value; @@ -424,7 +429,8 @@ export default class Base extends React.Component { ); } - const menuProps = { + const customProps = { + ...menuProps, children, role: 'listbox', selectedKeys, @@ -455,7 +461,7 @@ export default class Base extends React.Component { ref(c); this.menuRef = c; }} - {...menuProps} + {...customProps} > {items} @@ -466,7 +472,7 @@ export default class Base extends React.Component { ) : ( - + ); }