Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(menu): improve menu interactive behavior #199

Merged
merged 3 commits into from
Jun 24, 2021
Merged

fix(menu): improve menu interactive behavior #199

merged 3 commits into from
Jun 24, 2021

Conversation

mortalYoung
Copy link
Collaborator

简介

  • 优化 menu 组件的交互行为
  • 修复 menu 在某种情况下无法关闭的 bug

主要变更

  • 移除在 li 上的事件监听,统一在最外层的 Menu ul 上添加事件监听,通过事件委托的方式实现对子菜单的控制
  • 优化展示的样式,本来是通过 visibility 来控制展示,现在通过 opacity + pointer-event + transition 来控制展示,并起到一个过渡动画的效果
  • 计算位置的逻辑无改动,仅做移动
  • 计算是否展示子菜单的逻辑做了改动与简化
  • 在 menu item 上新增 data-submenu 属性用来区别该 item 是否具有子菜单
  • 优化 hover 和 active 样式

Related Issues

Closed #197

@mortalYoung mortalYoung added the bug Something isn't working label Jun 24, 2021
src/style/theme/menu.scss Outdated Show resolved Hide resolved
@wewoor wewoor added this to the 0.9.0-alpha.3 milestone Jun 24, 2021
@wewoor wewoor merged commit a8ba3e3 into main Jun 24, 2021
@wewoor wewoor deleted the fix/menu branch June 24, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submenu hide incorrect
2 participants