Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31e9394

Browse files
committed
Dropdown: Added scrollbar
1 parentd57085e commit31e9394

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎client/packages/lowcoder-design/src/components/Dropdown.tsx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ReactNode } from "react";
66
importstyledfrom"styled-components";
77
import{CustomSelect}from"./customSelect";
88
import{EllipsisTextCss}from"./Label";
9+
import{useEffect}from"react";
910
import{TacoMarkDown}from"./markdown";
1011
import{Tooltip,ToolTipLabel}from"./toolTip";
1112

@@ -157,6 +158,19 @@ interface DropdownProps<T extends OptionsType> extends Omit<SelectProps, "placem
157158
exportfunctionDropdown<TextendsOptionsType>(props:DropdownProps<T>){
158159
const{ placement="right"}=props;
159160
constvalueInfoMap=_.fromPairs(props.options.map((option)=>[option.value,option]));
161+
162+
useEffect(()=>{
163+
constdropdownElems=document.querySelectorAll<HTMLElement>("div.ant-dropdown ul.ant-dropdown-menu");
164+
for(letindex=0;index<dropdownElems.length;index++){
165+
constelement=dropdownElems[index];
166+
console.log(element);
167+
element.style.maxHeight="300px";
168+
element.style.overflowY="scroll";
169+
element.style.minWidth="150px";
170+
element.style.paddingRight="10px";
171+
}
172+
},[]);
173+
160174
return(
161175
<FlexDivstyle={props.style}className={props.className}>
162176
{props.label&&(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp