🐛(component): [dropdown]修复点击菜单项时只能关闭当前层级的问题

This commit is contained in:
sight 2022-09-10 23:03:24 +08:00
parent c00657554f
commit f28d43f03e

View File

@ -541,6 +541,11 @@ const handleFocusout = () => {
hide();
};
const handleContextHide = () => {
hide();
dropdownCtx?.hide();
}
const addChildRef = (ref: any) => {
childrenRefs.add(ref);
dropdownCtx?.addChildRef(ref);
@ -648,7 +653,7 @@ provide(
onMouseleave: handleMouseLeaveWithContext,
addChildRef,
removeChildRef,
hide,
hide: handleContextHide,
})
);