Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/components/MultiselectMenu/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const Dropdown = ({ level, setLevel, options, onSelect, value, menuOpen }: Props
const optionsRef = useRef(new Map());
const containerRef = useRef(null);

const selectedOption = options.find((opt) => opt.value === value);

const handleSetOptionRef = useCallback((optionValue: any) => (node: HTMLButtonElement | null) => {
if (node) {
optionsRef.current.set(optionValue, node);
Expand All @@ -37,16 +35,16 @@ const Dropdown = ({ level, setLevel, options, onSelect, value, menuOpen }: Props
}, [setLevel, level]);

useEffect(() => {
if (menuOpen && selectedOption && containerRef.current) {
const selectedNode = optionsRef.current.get(selectedOption.value);
if (menuOpen && containerRef.current) {
const selectedNode = optionsRef.current.get(value);
if (selectedNode) {
selectedNode.scrollIntoView({
behavior: 'smooth',
block: 'nearest'
});
}
}
}, [menuOpen, selectedOption]);
}, [menuOpen, value]);

return (
<div
Expand Down
14 changes: 10 additions & 4 deletions src/routes/MetaDetails/StreamsList/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@

.select-choices-wrapper {
display: flex;
flex-wrap: wrap;
align-items: center;
z-index: 2;
margin: 1em 1em 0 1em;
gap: 0 0.5em;
gap: 0.75em 0.5em;
overflow: visible;

.back-button-container {
Expand Down Expand Up @@ -105,18 +106,23 @@
}

.episode-title {
min-width: 45%;
flex: 1 1 auto;
min-width: 0;
color: var(--primary-foreground-color);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.select-input-container {
min-width: 40%;
flex-grow: 1;
flex: 1 1 100%;
min-width: 0;
background-color: none;

[role='listbox'] {
max-height: 60vh;
}

&:hover, &:focus, &:global(.active) {
background-color: var(--overlay-color);
}
Expand Down