Skip to content

Commit 9ebfa45

Browse files
committed
Fix GIF menu rendering in diff view table rows
1 parent 79b232b commit 9ebfa45

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ function addToolbarButton(toolbar) {
115115
return;
116116
}
117117

118+
// Check if the toolbar is inside a table row (e.g., in diff views)
119+
const tableRow = toolbar.closest('tr');
120+
if (tableRow) {
121+
debugLog('Found toolbar inside table row, adding class');
122+
tableRow.classList.add('ghg-has-toolbar');
123+
}
124+
118125
// Find the toolbar group to add our button to
119126
const isNewToolbar = toolbar.getAttribute('aria-label') === 'Formatting tools';
120127
let toolbarGroup;

src/style.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@
6060
overflow: visible !important;
6161
}
6262

63+
/*
64+
* Fixes the GIF menu not overflowing the toolbar
65+
* Allows the GIF dropdown to be visible outside the toolbar container
66+
*/
67+
.ghg-has-giphy-field
68+
[class*="Toolbar-module__toolbar"][class*="prc-ActionBar-Nav"] {
69+
overflow: visible !important;
70+
}
71+
72+
/*
73+
* Fixes the GIF menu appearing below the code diff
74+
* When the toolbar is inside a table row (e.g., in PR diff views),
75+
* this ensures the GIF dropdown appears above other content
76+
*/
77+
.ghg-has-toolbar {
78+
position: relative;
79+
z-index: 5;
80+
}
81+
6382
/*
6483
* Override for GitHub's toolbar alignment bug
6584
*

0 commit comments

Comments
 (0)