Skip to content

Commit a324c5d

Browse files
committed
fix dropdown
1 parent 3f9eeed commit a324c5d

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/lib/consts.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ export const RANGE_STYLE = {
114114
};
115115
export const DEFAULT_SELECT_PROPS = {
116116
classNamePrefix: "react-select",
117+
styles: {
118+
menu: (provided: any) => ({
119+
...provided,
120+
zIndex: 9999,
121+
}),
122+
menuPortal: (provided: any) => ({
123+
...provided,
124+
zIndex: 9999,
125+
}),
126+
},
117127
};
118128
export const DEFAULT_LINKIFY_PROPS: Partial<LinkifyProps> = {
119129
textDecorator: (str) => str.replace(/^https?:\/\//, ""),

src/styles/_base.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,14 @@ input::-webkit-inner-spin-button {
152152
* Vendors:
153153
*/
154154
.react-select__menu-portal {
155-
z-index: $zindex-tooltip !important;
155+
z-index: 9999 !important;
156156
}
157157
.react-select__control {
158158
border-color: black !important;
159159
}
160160
.react-select__menu {
161161
margin-bottom: 1em;
162+
z-index: 9999 !important;
162163
}
163164
.react-select__menu-list {
164165
@extend .custom-scrollbar;

src/views/ReadabilityBlock.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@ import { VscSettings } from "react-icons/vsc";
88
import Select from "react-select";
99

1010
import {
11-
DEFAULT_EDGE_SIZE_RATIO,
1211
DEFAULT_LABEL_SIZE,
1312
DEFAULT_LABEL_THRESHOLD,
14-
DEFAULT_NODE_SIZE_RATIO,
1513
LABEL_SIZE_STEP,
1614
LABEL_THRESHOLD_STEP,
1715
MAX_LABEL_SIZE,
1816
MAX_LABEL_THRESHOLD,
19-
MAX_NODE_SIZE_RATIO,
2017
MIN_LABEL_SIZE,
2118
MIN_LABEL_THRESHOLD,
22-
MIN_NODE_SIZE_RATIO,
23-
NODE_SIZE_RATIO_STEP,
2419
RANGE_STYLE,
2520
SLIDER_STYLE,
2621
DEFAULT_SELECT_PROPS,
@@ -36,13 +31,11 @@ interface Option {
3631

3732
const ReadabilityBlock: FC = () => {
3833
// const { navState, setNavState } = useContext(GraphContext);
39-
const { navState, setNavState, showEditionPanel, setShowEditionPanel, setShowEdgePanel, data } = useContext(GraphContext);
34+
const { navState, setNavState, setShowEditionPanel, setShowEdgePanel, data } = useContext(GraphContext);
4035
const [initialNavState] = useState<NavState>(navState);
4136

4237
const minLabelSize = typeof navState.minLabelSize === "number" ? navState.minLabelSize : DEFAULT_LABEL_SIZE;
4338
const maxLabelSize = typeof navState.maxLabelSize === "number" ? navState.maxLabelSize : DEFAULT_LABEL_SIZE;
44-
const nodeSizeRatio = typeof navState.nodeSizeRatio === "number" ? navState.nodeSizeRatio : DEFAULT_NODE_SIZE_RATIO;
45-
const edgeSizeRatio = typeof navState.edgeSizeRatio === "number" ? navState.edgeSizeRatio : DEFAULT_EDGE_SIZE_RATIO;
4639
const labelThresholdRatio =
4740
typeof navState.labelThresholdRatio === "number" ? navState.labelThresholdRatio : DEFAULT_LABEL_THRESHOLD;
4841

@@ -144,7 +137,7 @@ const ReadabilityBlock: FC = () => {
144137
<FaTimes /> Restore default
145138
</button>
146139
</h3>
147-
<div className="pb-3">
140+
<div className="pb-3" style={{ marginBottom: '2rem' }}>
148141
<Select
149142
{...DEFAULT_SELECT_PROPS}
150143
isMulti

0 commit comments

Comments
 (0)