Skip to content
代码片段 群组 项目
未验证 提交 d82a39b0 编辑于 作者: Mireya Andres's avatar Mireya Andres 提交者: GitLab
浏览文件

Merge branch...

Merge branch '471315-apply-hover-effect-to-side-menu-navigation-items-when-interacting-with-the-flyout-menu' into 'master' 

Keep hover effect on section title when flyout is hovered

Closes #471315

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/160233



Merged-by: default avatarMireya Andres <mandres@gitlab.com>
Approved-by: default avatarDoug Stull <dstull@gitlab.com>
Approved-by: default avatarMireya Andres <mandres@gitlab.com>
Reviewed-by: default avatarMireya Andres <mandres@gitlab.com>
Co-authored-by: default avatarThomas Hutterer <thutterer@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -62,7 +62,10 @@ export default {
return this.isExpanded ? 'chevron-up' : 'chevron-down';
},
computedLinkClasses() {
return this.isActive ? NAV_ITEM_LINK_ACTIVE_CLASS : null;
return {
[NAV_ITEM_LINK_ACTIVE_CLASS]: this.isActive,
'with-mouse-over-flyout': this.isMouseOverFlyout,
};
},
isActive() {
return !this.isExpanded && this.item.is_active;
......
......@@ -427,7 +427,8 @@ $command-palette-spacing: px-to-rem(14px);
.super-sidebar-nav-item {
&:hover,
&:focus {
&:focus,
&.with-mouse-over-flyout {
background-color: var(--super-sidebar-nav-item-hover-bg);
}
......
......@@ -103,14 +103,24 @@ describe('MenuSection component', () => {
});
describe('when section has items', () => {
it('is rendered and shown', async () => {
beforeEach(() => {
createWrapper(
{ title: 'Asdf', items: [{ title: 'Item1', href: '/item1' }] },
{ 'has-flyout': true, expanded: false },
);
});
it('is rendered and shown', async () => {
await findButton().trigger('pointerover', { pointerType: 'mouse' });
expect(findFlyout().isVisible()).toBe(true);
});
it('adds a class to keep hover effect on button while flyout is hovered', async () => {
await findButton().trigger('pointerover', { pointerType: 'mouse' });
expect(findButton().classes()).not.toContain('with-mouse-over-flyout');
await findFlyout().vm.$emit('mouseover');
expect(findButton().classes()).toContain('with-mouse-over-flyout');
});
});
});
});
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册