-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cascader): The Cascader component enforces isSelectIconRight to be false to prevent potential style conflicts that may arise when isSelectIconRight is set to true #3852 #4984
base: next
Are you sure you want to change the base?
Conversation
…g Enter, the value should not change,closed alibaba-fusion#4896
38201f1
to
ebc296a
Compare
components/cascader-select/types.ts
Outdated
@@ -244,7 +244,7 @@ export interface CascaderSelectProps | |||
*/ | |||
treeCheckable?: boolean; | |||
/** | |||
* 透传到 Cascader 的属性对象 | |||
* 透传到 Cascader 的属性对象;isSelectIconRight,onItemFocus,onBlur传入无效 | |||
* @en props object passed to Cascader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文版的也需要对应的提示信息
components/cascader/cascader.tsx
Outdated
@@ -109,6 +109,13 @@ const normalizeValue = <T,>(value: T): NormalizeValueReturns<T> => { | |||
return [] as NormalizeValueReturns<T>; | |||
}; | |||
|
|||
const getFormatMenuProps = (others: Record<string, unknown>) => { | |||
return { | |||
...pickProps(['onItemFocus', 'onItemClick', 'onItemKeyDown', 'embeddable'], others), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pickProps 是从里面获取属性,你这里要过滤掉对应数据还是获取数据对应的数据?这里的筛选的参数需要再确定一下
components/cascader/cascader.tsx
Outdated
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; | |||
import { polyfill } from 'react-lifecycles-compat'; | |||
import cloneDeep from 'lodash.clonedeep'; | |||
import cx from 'classnames'; | |||
import Menu, { type ItemProps, type CheckboxItemProps } from '../menu'; | |||
import Menu, { type ItemProps, type CheckboxItemProps, type MenuProps } from '../menu'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MenuProps 没用到就删了吧
<CascaderSelect dataSource={ChinaArea} menuProps={{ listStyle: { width: '200px' } }} /> | ||
); | ||
cy.get('.next-select').click(); | ||
cy.get('.next-cascader-menu-wrapper').should('have.css', 'width', '200px'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个单测不对,即使没有本次的改动,这个单测也是通过的,需要调整成新逻辑下可以透传到Menu的属性进行检测
ebc296a
to
c1325b4
Compare
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; | |||
import { polyfill } from 'react-lifecycles-compat'; | |||
import cloneDeep from 'lodash.clonedeep'; | |||
import cx from 'classnames'; | |||
import { omit as lodashOmit } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉 lodash
@@ -102,7 +102,20 @@ export interface CascaderMenuProps extends CommonProps, MenuProps { | |||
*/ | |||
export interface CascaderProps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要加一个 remark
#3852