fix(ui): tweak floating-ui dropdowns

This commit is contained in:
Łukasz Mierzwa
2022-03-20 18:30:35 +00:00
committed by Łukasz Mierzwa
parent bdfa962731
commit 5725add74f
3 changed files with 2 additions and 8 deletions

View File

@@ -72,7 +72,6 @@ const HistoryMenu: FC<{
y: number | null;
floating: Ref<HTMLDivElement> | null;
strategy: CSSProperties["position"];
maxWidth: number | null;
maxHeight: number | null;
filters: ReduceFilterT[][];
alertStore: AlertStore;
@@ -84,7 +83,6 @@ const HistoryMenu: FC<{
y,
floating,
strategy,
maxWidth,
maxHeight,
filters,
alertStore,
@@ -102,7 +100,6 @@ const HistoryMenu: FC<{
position: strategy,
top: y ?? "",
left: x ?? "",
maxWidth: maxWidth ?? "",
maxHeight: maxHeight ?? "",
}}
>
@@ -195,7 +192,6 @@ const History: FC<{
// this will be dumped to local storage via mobx-stored
const [history] = useState<HistoryStorage>(new HistoryStorage());
const [isVisible, setIsVisible] = useState<boolean>(false);
const [maxWidth, setMaxWidth] = useState<number | null>(null);
const [maxHeight, setMaxHeight] = useState<number | null>(null);
const hide = useCallback(() => setIsVisible(false), []);
const toggle = useCallback(() => setIsVisible(!isVisible), [isVisible]);
@@ -207,8 +203,7 @@ const History: FC<{
flip(),
offset(5),
size({
apply({ width, height }) {
setMaxWidth(width);
apply({ height }) {
setMaxHeight(height);
},
}),
@@ -279,7 +274,6 @@ const History: FC<{
y={y}
floating={floating}
strategy={strategy}
maxWidth={maxWidth}
maxHeight={maxHeight}
/>
</DropdownSlide>

View File

@@ -176,7 +176,6 @@ storiesOf("NavBar", module).add("NavBar", () => {
y={0}
floating={null}
strategy={"absolute"}
maxWidth={null}
maxHeight={null}
filters={history}
onClear={() => {}}

View File

@@ -1,6 +1,7 @@
.dropdown-menu.components-navbar-historymenu {
white-space: nowrap;
overflow: scroll;
width: 100%;
}
.dropdown-menu.components-navbar-historymenu > .dropdown-item {