Skip to content

Dropdown selection obscured by sticky title #576

Closed

Description

@LangLangBart

Before submitting your bug report

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

{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

  1. open continue, you may need to use a larger font, for example, 16pt
  2. enter @file
  3. move around with ↑/↓ keys
  4. occasionally, some selected items in the list may be hidden below the title.

Log output

No response

Activity

  1. sestinj commented on Oct 23, 2023

    @sestinj
    Contributor

    @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

  2. sestinj commented on Nov 5, 2023

    @sestinj
    Contributor

    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!

  3. added
    kind:bug
    on Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions