Skip to content
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

Open
wants to merge 22 commits into
base: next
Choose a base branch
from

Conversation

sqq1992
Copy link
Collaborator

@sqq1992 sqq1992 commented Nov 22, 2024

@sqq1992 sqq1992 changed the base branch from master to next November 22, 2024 03:03
@sqq1992 sqq1992 force-pushed the fix-issue-3852 branch 3 times, most recently from 38201f1 to ebc296a Compare December 5, 2024 06:09
@@ -244,7 +244,7 @@ export interface CascaderSelectProps
*/
treeCheckable?: boolean;
/**
* 透传到 Cascader 的属性对象
* 透传到 Cascader 的属性对象;isSelectIconRight,onItemFocus,onBlur传入无效
* @en props object passed to Cascader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英文版的也需要对应的提示信息

@@ -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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pickProps 是从里面获取属性,你这里要过滤掉对应数据还是获取数据对应的数据?这里的筛选的参数需要再确定一下

@@ -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';
Copy link
Contributor

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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个单测不对,即使没有本次的改动,这个单测也是通过的,需要调整成新逻辑下可以透传到Menu的属性进行检测

@@ -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';
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要加一个 remark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants