Skip to content

Commit

Permalink
fix[Select|Cascader]: select multiple error & cascader error in ssr m…
Browse files Browse the repository at this point in the history
…ode (#7377)

* docs: updating the `dropdownRender` description and jumps in the FAQ for Select

* fix: fix  select error in multiple mode

* fix: fix cascader select error in ssr mode
  • Loading branch information
cc-hearts authored Apr 19, 2024
1 parent 162d1fc commit c28c38d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/vc-cascader/OptionList/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { DefaultOptionType, SingleValueType } from '../Cascader';
import { SEARCH_MARK } from '../hooks/useSearchOptions';
import type { Key } from '../../_util/type';
import { useInjectCascader } from '../context';
import { cloneVNode } from 'vue';
export const FIX_LABEL = '__cascader_fix_label__';
export interface ColumnProps {
prefixCls: string;
Expand Down Expand Up @@ -151,10 +152,10 @@ export default function Column({
)}
<div class={`${menuItemPrefixCls}-content`}>{label}</div>
{!isLoading && expandIcon && !isMergedLeaf && (
<div class={`${menuItemPrefixCls}-expand-icon`}>{expandIcon}</div>
<div class={`${menuItemPrefixCls}-expand-icon`}>{cloneVNode(expandIcon)}</div>
)}
{isLoading && loadingIcon && (
<div class={`${menuItemPrefixCls}-loading-icon`}>{loadingIcon}</div>
<div class={`${menuItemPrefixCls}-loading-icon`}>{cloneVNode(loadingIcon)}</div>
)}
</li>
);
Expand Down
4 changes: 2 additions & 2 deletions components/vc-select/TransBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FunctionalComponent, PropType } from 'vue';
import { cloneVNode, type FunctionalComponent, type PropType } from 'vue';
import type { MouseEventHandler } from '../_util/EventInterface';
import type { VueNode } from '../_util/type';
import PropTypes from '../_util/vue-types';
Expand All @@ -23,7 +23,7 @@ const TransBtn: TransBtnType = (props, { slots }) => {
if (typeof customizeIcon === 'function') {
icon = customizeIcon(customizeIconProps);
} else {
icon = customizeIcon;
icon = cloneVNode(customizeIcon);
}

return (
Expand Down

0 comments on commit c28c38d

Please sign in to comment.