-
Notifications
You must be signed in to change notification settings - Fork 210
feat(drop-down): 下拉菜单新增right-click触发方式 (#294) #364
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
feat(drop-down): 下拉菜单新增right-click触发方式 (#294) #364
Conversation
Simplelegant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!感谢贡献
| } | ||
| @HostListener('contextmenu', ['$event']) | ||
| toggleOnContextMenu(event: MouseEvent) { | ||
| if (!this.disabled && this.dropdown.trigger === 'right-click') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最新提交已经修复,hover保持原样
修改的部分涉及到原本hover时,也可以通过click触发,增加了右击的判断
| | --------------------- |----------------------------------------------| ------- |-------------------------------------------------------------------------------| ------------------------------------------------------ | ---------- | | ||
| | isOpen | `boolean` | false | 可选,可以显示指定 dropdown 是否打开 | [设置 isOpen 控制下拉](demo#dropdown-set-is-open) | | | ||
| | disabled | `boolean` | false | 可选,设置为 true 禁用 dropdown | | | | ||
| | trigger | `'click'\|'hover'\|'manually\|'right-click'` | 'click' | 可选,dropdown 触发方式, click 为点击,hover 为悬停(也包含点击)、manually 为完全手动控制、right-click 为右击 | [悬浮下拉](demo#suspension-drop-down) | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文文档也要同步下修改内容
| } | ||
| return false; | ||
| } | ||
| @HostListener('contextmenu', ['$event']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mac的contextmenu事件早于点击触发,可能会导致下拉触发后,宿主的点击事件冒泡下去触发关闭逻辑导致下拉打不开,我这没有mac电脑,有条件可以测试下,或者toggle里防御一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在mac中使用chrome验证通过,触控板右击不会触发click,只会触发contextmenu
feat(drop-down): 下拉菜单新增right-click触发方式 (#294) (#364) Created-by: GreatZP Commit-by: xucr11;锐来锐好;caoxicheng Merged-by: GreatZP Description: feat(drop-down): 下拉菜单新增right-click触发方式 (#294) (#364) fix(module:date-picker-pro): tab type demo fix(module:date-picker-pro): border radius style fix(module:modal): empty modal footer style fix(module:modal): empty modal footer style See merge request: DevCloudFE/ng-devui!6

No description provided.