Skip to content

Commit e88c25e

Browse files
committed
minor tweaks
1 parent b7c6e8e commit e88c25e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ import {
1818
import { ContextContainerComp } from "./contextContainerComp";
1919
import { ListViewImplComp } from "./listViewComp";
2020
import { getCurrentItemParams, getData } from "./listViewUtils";
21+
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
2122
import { childrenToProps } from "@lowcoder-ee/comps/generators/multi";
2223
import { AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants";
2324

24-
const ListViewWrapper = styled.div<{ $style: any; $paddingWidth: string,$animationStyle:AnimationStyleType }>`
25+
const ListViewWrapper = styled.div<{ $style: any; $paddingWidth: string,$animationStyle:AnimationStyleType, $autoHeight: boolean }>`
2526
height: 100%;
27+
overflow: ${(props) => (!props.$autoHeight ? "scroll" : "hidden")};
2628
border: 1px solid ${(props) => props.$style.border};
2729
border-radius: ${(props) => props.$style.radius};
2830
padding: 3px ${(props) => props.$paddingWidth};
2931
rotate: ${(props) => props.$style.rotation};
3032
background-color: ${(props) => props.$style.background};
3133
${props=>props.$animationStyle}
34+
3235
`;
3336

3437
const FooterWrapper = styled.div`
@@ -190,7 +193,7 @@ export function ListView(props: Props) {
190193
const horizontalGridCells = useMemo(() => children.horizontalGridCells.getView(), [children.horizontalGridCells]);
191194
const autoHeight = useMemo(() => children.autoHeight.getView(), [children.autoHeight]);
192195
const showHorizontalScrollbar = useMemo(() => children.showHorizontalScrollbar.getView(), [children.showHorizontalScrollbar]);
193-
const showVerticalScrollbar = useMemo(() => children.showVerticalScrollbar.getView(), [children.showVerticalScrollbar]);
196+
const showVerticalScrollbar = useMemo(() => children.showVerticalScrollbar.getView(), [children.showVerticalScrollbar])
194197
const horizontal = useMemo(() => children.horizontal.getView(), [children.horizontal]);
195198
const minHorizontalWidth = useMemo(() => children.minHorizontalWidth.getView(), [children.minHorizontalWidth]);
196199
const noOfColumns = useMemo(
@@ -284,12 +287,14 @@ export function ListView(props: Props) {
284287

285288
const childrenProps = childrenToProps(comp.children);
286289

290+
useMergeCompStyles(childrenProps, comp.dispatch);
291+
287292
// log.debug("renders: ", renders);
288293
return (
289294
<BackgroundColorContext.Provider value={style.background}>
290-
<ListViewWrapper $style={style} $paddingWidth={paddingWidth} $animationStyle={animationStyle}>
295+
<ListViewWrapper $style={style} $paddingWidth={paddingWidth} $animationStyle={animationStyle} $autoHeight={autoHeight}>
291296
<BodyWrapper ref={ref} $autoHeight={autoHeight}>
292-
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={horizontal?!showHorizontalScrollbar:!showVerticalScrollbar} overflow={autoHeight?horizontal?'scroll':'hidden':'scroll'}>
297+
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={horizontal ? !showHorizontalScrollbar : !showVerticalScrollbar} overflow={autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll'}>
293298
<ReactResizeDetector
294299
onResize={(width?: number, height?: number) => {
295300
if (height) setListHeight(height);
@@ -315,3 +320,4 @@ export function ListView(props: Props) {
315320
</BackgroundColorContext.Provider>
316321
);
317322
}
323+

client/packages/lowcoder/src/comps/comps/tableComp/tableCompView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ const TableWrapper = styled.div<{
225225
border-left: unset;
226226
border-top: none !important;
227227
border-inline-start: none !important;
228-
overflow-y:scroll;
229-
height:300px;
230228
231229
&::after {
232230
box-shadow: none !important;

client/packages/lowcoder/src/comps/comps/tabs/tabbedContainerComp.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
238238
);
239239
return {
240240
label,
241-
key: tab.key,
241+
key: tab.key,
242242
forceRender: true,
243243
children: (
244244
<BackgroundColorContext.Provider value={bodyStyle.background}>
@@ -259,7 +259,6 @@ const TabbedContainer = (props: TabbedContainerProps) => {
259259
})
260260

261261
return (
262-
<ScrollBar style={{ height: props.autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!props.showVerticalScrollbar} >
263262
<div style={{padding: props.style.margin, height: props.autoHeight ? "auto" : "100%"}}>
264263
<BackgroundColorContext.Provider value={headerStyle.headerBackground}>
265264
<StyledTabs
@@ -286,7 +285,6 @@ const TabbedContainer = (props: TabbedContainerProps) => {
286285
</StyledTabs>
287286
</BackgroundColorContext.Provider>
288287
</div>
289-
</ScrollBar>
290288
);
291289
};
292290

@@ -466,3 +464,4 @@ export const TabbedContainerComp = withExposingConfigs(TabbedContainerImplComp,
466464
new NameConfig("selectedTabKey", trans("tabbedContainer.selectedTabKeyDesc")),
467465
NameConfigHidden,
468466
]);
467+

0 commit comments

Comments
 (0)