arco-design / arco-design-pro

An out-of-the-box solution to quickly build enterprise-level applications based on Arco Design.
https://pro.arco.design
MIT License
485 stars 95 forks source link

fix: menu key not updated & remove redundant Link #74

Closed hkhere closed 2 years ago

hkhere commented 2 years ago

Types of changes

Background and context

The selected menu keys are not updated when using functions like history.goBack() or using browers' default go back button. This is caused becuase the selected menu keys are only updated when a user click a menu item which calls onClickMenuItem inside which the selected keys get updated.

The Link element is redundant because inside onClickMenuItem the corresponding link was already pushed using history.push when a user clicks a menu item. If the Link element is not removed, it causes browser to push the link twice at one click, so a user needs to click go back twice to get to the original link.

Solution

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

Other information