Repository navigation
Closed
Labels
kind:bugIndicates an unexpected problem or unintended behavior
Description
Before submitting your bug report
- I believe this is a bug. I'll try to join the Continue Discord for questions
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- Continue: 0.0.413 (2023-10-23T03:23:34.417Z)Description
Description
In the ComboBox.tsx file, the sticky title and its description of the dropdown menu result in the currently selected item being partially or fully obscured.
Example
This issue is particularly evident with items at the top of the dropdown list, as shown in the GIF below. It often occurs when navigating upwards using the arrow keys.
Bisect
This issue was first observed in commit: 8d423fd
continue/extension/react-app/src/components/ComboBox.tsx
Lines 697 to 720 in 8d423fd
| {nestedContextProvider && ( | |
| <div | |
| style={{ | |
| backgroundColor: secondaryDark, | |
| borderBottom: `1px solid ${lightGray}`, | |
| display: "flex", | |
| gap: "4px", | |
| position: "sticky", | |
| top: "0px", | |
| }} | |
| className="py-2 px-4 my-0" | |
| > | |
| <ArrowLeftIcon | |
| width="1.4em" | |
| height="1.4em" | |
| className="cursor-pointer" | |
| onClick={() => { | |
| goBackToContextProviders(); | |
| }} | |
| /> | |
| {nestedContextProvider.display_title} -{" "} | |
| {nestedContextProvider.description} | |
| </div> | |
| )} |
fix attempt
The required solution shall ensure that the list items do not go underneath the sticky title and description.
The 50px shouldn't be hardcoded, but rather the height of the div with the sticky title.
--- a/gui/src/components/ComboBox.tsx
+++ b/gui/src/components/ComboBox.tsx
@@ -1311,6 +1311,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
{nestedContextProvider.description}
</div>
)}
+ <div style={{ maxHeight: `${UlMaxHeight - 50}px`, overflow: 'auto' }}>
{downshiftProps.isOpen &&
items.map((item, index) => (
<Li
@@ -1364,6 +1365,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
)}
</Li>
))}
+ </div>
{downshiftProps.isOpen && items.length === 0 && (
<Li
key="empty-items-li"
To reproduce
- open
continue, you may need to use a larger font, for example, 16pt - enter
@file - move around with ↑/↓ keys
- occasionally, some selected items in the list may be hidden below the title.
Log output
No response
Metadata
Metadata
Assignees
Labels
kind:bugIndicates an unexpected problem or unintended behavior
Activity
sestinj commentedon Oct 23, 2023
@LangLangBart Thanks for this, the fix worked perfectly, I just made sure to add a ref to get the height of the sticky div: 7b97486
I'll keep this open until change has been pushed to a pre-release version
sestinj commentedon Nov 5, 2023
Accidentally regressed the solution in a merge conflict, but fixed again and on its way to pre-release. Going to close the issue. Thank you again!