Skip to content

Commit ef51ede

Browse files
committed
fix: menu loose submenu id
1 parent cc2d155 commit ef51ede

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

components/auto-complete/__tests__/__snapshots__/demo.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports[`renders ./antdv-demo/docs/auto-complete/demo/custom.md correctly 1`] =
3030
<div class="ant-select ant-select-show-search ant-select-auto-complete ant-select-single ant-select-customize-input" style="width: 200px;">
3131
<!---->
3232
<!---->
33-
<div class="ant-select-selector"><span class="ant-select-selection-search"><textarea placeholder="input here" class="ant-input" id="rc_select_TEST_OR_SSR" autocomplete="off" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0"></textarea></span>
33+
<div class="ant-select-selector"><span class="ant-select-selection-search"><textarea placeholder="input here" class="ant-input ant-select-selection-search-input" style="height: 50px;" id="rc_select_TEST_OR_SSR" autocomplete="off" role="combobox" aria-haspopup="listbox" aria-owns="rc_select_TEST_OR_SSR_list" aria-autocomplete="list" aria-controls="rc_select_TEST_OR_SSR_list" aria-activedescendant="rc_select_TEST_OR_SSR_list_0"></textarea></span>
3434
<!----><span class="ant-select-selection-placeholder"><!----></span>
3535
</div>
3636
<!---->

components/style/themes/default.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
@ease-base-in: cubic-bezier(0.9, 0, 0.3, 0.7);
9999
@ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
100100
@ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19);
101-
@ease-in-out: cubic-bezier(0.25, 0.8, 0.5, 1);
101+
@ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
102102
@ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46);
103103
@ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6);
104104
@ease-in-out-back: cubic-bezier(0.71, -0.46, 0.29, 1.46);

components/vc-menu/SubMenu.jsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@ const SubMenu = defineComponent({
432432
const isOpen = this.isOpen;
433433
const prefixCls = this.getPrefixCls();
434434
const isInlineMode = props.mode === 'inline';
435+
if (!this.internalMenuId) {
436+
if (props.eventKey) {
437+
this.internalMenuId = `${props.eventKey}$Menu`;
438+
} else {
439+
this.internalMenuId = `$__$${++guid}$Menu`;
440+
}
441+
}
435442
const children = this.renderChildren();
436443
const className = {
437444
[prefixCls]: true,
@@ -442,14 +449,6 @@ const SubMenu = defineComponent({
442449
[this.getDisabledClassName()]: props.disabled,
443450
[this.getSelectedClassName()]: this.isChildrenSelected || this.isChildrenSelected2(),
444451
};
445-
if (!this.internalMenuId) {
446-
if (props.eventKey) {
447-
this.internalMenuId = `${props.eventKey}$Menu`;
448-
} else {
449-
this.internalMenuId = `$__$${++guid}$Menu`;
450-
}
451-
}
452-
453452
let mouseEvents = {};
454453
let titleClickEvents = {};
455454
let titleMouseEvents = {};

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
},
6363
"homepage": "https://www.antdv.com/",
6464
"peerDependencies": {
65-
"@vue/compiler-sfc": ">=3.0.2",
66-
"vue": ">=3.0.2"
65+
"@vue/compiler-sfc": ">=3.0.4",
66+
"vue": ">=3.0.4"
6767
},
6868
"devDependencies": {
6969
"@babel/cli": "^7.8.4",
@@ -92,7 +92,7 @@
9292
"@typescript-eslint/parser": "^4.1.0",
9393
"@vue/babel-plugin-jsx": "^1.0.0-rc.3",
9494
"@vue/cli-plugin-eslint": "^4.0.0",
95-
"@vue/compiler-sfc": "^3.0.2",
95+
"@vue/compiler-sfc": "^3.0.4",
9696
"@vue/eslint-config-prettier": "^6.0.0",
9797
"@vue/eslint-config-typescript": "^5.1.0",
9898
"@vue/test-utils": "^2.0.0-beta.2",
@@ -178,7 +178,7 @@
178178
"umi-mock-middleware": "^1.0.0",
179179
"umi-request": "^1.3.5",
180180
"url-loader": "^3.0.0",
181-
"vue": "^3.0.2",
181+
"vue": "^3.0.4",
182182
"vue-antd-md-loader": "^1.2.1-beta.1",
183183
"vue-clipboard2": "0.3.1",
184184
"vue-draggable-resizable": "^2.1.0",

0 commit comments

Comments
 (0)