Skip to content

Commit 2740a71

Browse files
committed
[ZEPPELIN-6384] Fix dropdown menu item links not clickable in full area
### What is this PR for? #### Summary - Fixed dropdown menu items in header where only text was clickable instead of the full item area - Changed routerLinkActive to nzMatchRouter for proper NG-ZORRO integration - Added CSS pseudo-element to expand clickable area of anchor tags #### Cause - Likely due to NG-ZORRO dropdown menu item anchor tag style changes that reduced the clickable area to just the text content. #### Changes - Updated `header.component.html`: Replace `routerLinkActive` with `nzMatchRouter` directive - Updated `global.less`: Add `::before` pseudo-element to `.ant-dropdown-menu-item > a` to expand clickable area using absolute positioning ### What type of PR is it? Bug Fix ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-6384 ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Closes #5124 from tbonelee/fix-dropdown-link. Signed-off-by: ChanHo Lee <[email protected]> (cherry picked from commit b4193a0) Signed-off-by: ChanHo Lee <[email protected]>
1 parent 4548a85 commit 2740a71

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

zeppelin-web-angular/src/app/share/header/header.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
<ul nz-menu>
5353
<li nz-menu-item (click)="about()">About Zeppelin</li>
5454
<li nz-menu-divider></li>
55-
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
55+
<li nz-menu-item nzMatchRouter>
5656
<a [routerLink]="['/interpreter']">Interpreter</a>
5757
</li>
58-
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
58+
<li nz-menu-item nzMatchRouter>
5959
<a [routerLink]="['/notebook-repos']">Notebook Repos</a>
6060
</li>
61-
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
61+
<li nz-menu-item nzMatchRouter>
6262
<a [routerLink]="['/credential']">Credential</a>
6363
</li>
64-
<!-- <li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">-->
64+
<!-- <li nz-menu-item nzMatchRouter>-->
6565
<!-- <a [routerLink]="['/helium']">Helium</a>-->
6666
<!-- </li>-->
67-
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
67+
<li nz-menu-item nzMatchRouter>
6868
<a [routerLink]="['/configuration']">Configuration</a>
6969
</li>
7070
<ng-container *ngIf="ticketService.ticket.principal !== 'anonymous'">

zeppelin-web-angular/src/styles/global.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@
115115
}
116116
}
117117

118+
// Fix `a` tag in nz-dropdown-menu to be clickable with full width
119+
.ant-dropdown-menu-item > a::before {
120+
position: absolute;
121+
inset: 0;
122+
background-color: transparent;
123+
content: '';
124+
}
125+
118126
//.view-lines {
119127
// .view-line {
120128
// &:first-child {

0 commit comments

Comments
 (0)