Skip to content

Commit e7fbaac

Browse files
authored
fix: update Menu type (#3173)
* fix: update Menu type * update
1 parent b84b981 commit e7fbaac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/menu/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const menuProps = {
2828
mode: MenuMode.def('vertical'),
2929
selectable: PropTypes.looseBool,
3030
selectedKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
31-
defaultSelectedKeys: PropTypes.array,
31+
defaultSelectedKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
3232
openKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
3333
defaultOpenKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
3434
openAnimation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
@@ -158,14 +158,14 @@ const Menu = defineComponent({
158158
this.restoreModeVerticalFromInline();
159159
this.$emit('mouseenter', e);
160160
},
161-
handleTransitionEnd(e) {
161+
handleTransitionEnd(e: TransitionEvent) {
162162
// when inlineCollapsed menu width animation finished
163163
// https://github.com/ant-design/ant-design/issues/12864
164164
const widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget;
165165

166166
// Fix SVGElement e.target.className.indexOf is not a function
167167
// https://github.com/ant-design/ant-design/issues/15699
168-
const { className } = e.target;
168+
const { className } = e.target as (SVGAnimationElement | HTMLElement);
169169
// SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during an animation.
170170
const classNameValue =
171171
Object.prototype.toString.call(className) === '[object SVGAnimatedString]'

0 commit comments

Comments
 (0)