Skip to content

Conversation

@caoxicheng
Copy link
Contributor

No description provided.

Copy link
Collaborator

@Simplelegant Simplelegant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!感谢贡献

@Simplelegant Simplelegant linked an issue Mar 29, 2025 that may be closed by this pull request
@Simplelegant Simplelegant self-requested a review March 29, 2025 09:19
}
@HostListener('contextmenu', ['$event'])
toggleOnContextMenu(event: MouseEvent) {
if (!this.disabled && this.dropdown.trigger === 'right-click') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

发现一个问题,trigger为'right-click'时点击左键也会打开下拉按钮,此种场景下应该要排查左键点击

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新提交已经修复,hover保持原样

修改的部分涉及到原本hover时,也可以通过click触发,增加了右击的判断
Simplelegant
Simplelegant previously approved these changes Mar 31, 2025
| --------------------- |----------------------------------------------| ------- |-------------------------------------------------------------------------------| ------------------------------------------------------ | ---------- |
| 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) | |

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'])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mac的contextmenu事件早于点击触发,可能会导致下拉触发后,宿主的点击事件冒泡下去触发关闭逻辑导致下拉打不开,我这没有mac电脑,有条件可以测试下,或者toggle里防御一下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在mac中使用chrome验证通过,触控板右击不会触发click,只会触发contextmenu

@GreatZPP GreatZPP merged commit c5bda5e into DevCloudFE:master Apr 1, 2025
1 check passed
GreatZPP added a commit that referenced this pull request May 22, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [Feature]: DropDown 下拉菜单 trigger 增加 'right-click'

4 participants