fix: select option not support click event
parent
520d6a5e85
commit
4ea00d3a70
|
@ -1 +1 @@
|
|||
Subproject commit ab88ac19de8ce0d3c8a559ad7bcd5fc04532c184
|
||||
Subproject commit 59408000f682c5495cf3d1106ab07f7c567bbc20
|
|
@ -356,16 +356,22 @@ const OptionList = defineComponent<OptionListProps, { state?: any }>({
|
|||
aria-selected={selected}
|
||||
class={optionClassName}
|
||||
title={optionTitle}
|
||||
onMousemove={() => {
|
||||
onMousemove={e => {
|
||||
if (otherProps.onMousemove) {
|
||||
otherProps.onMousemove(e);
|
||||
}
|
||||
if (activeIndex === itemIndex || disabled) {
|
||||
return;
|
||||
}
|
||||
setActive(itemIndex);
|
||||
}}
|
||||
onClick={() => {
|
||||
onClick={e => {
|
||||
if (!disabled) {
|
||||
onSelectValue(value);
|
||||
}
|
||||
if (otherProps.onClick) {
|
||||
otherProps.onClick(e);
|
||||
}
|
||||
}}
|
||||
style={style}
|
||||
>
|
||||
|
|
|
@ -10,7 +10,7 @@ function convertNodeToOption(node: VNode): OptionData {
|
|||
} = node as VNode & {
|
||||
children: { default?: () => any };
|
||||
};
|
||||
const child = children.default ? children.default() : undefined;
|
||||
const child = children && children.default ? children.default() : undefined;
|
||||
return {
|
||||
key,
|
||||
value: value !== undefined ? value : key,
|
||||
|
@ -43,7 +43,7 @@ export function convertChildrenToData(
|
|||
if (optionOnly || !isSelectOptGroup) {
|
||||
return convertNodeToOption(node);
|
||||
}
|
||||
const child = children.default ? children.default() : undefined;
|
||||
const child = children && children.default ? children.default() : undefined;
|
||||
return {
|
||||
key: `__RC_SELECT_GRP__${key === null ? index : key}__`,
|
||||
label: key,
|
||||
|
|
Loading…
Reference in New Issue