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

Commit81b6dfd

Browse files
disable comp select/drag/drop inside table expansions
1 parent1cdbf34 commit81b6dfd

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { selectCompModifierKeyPressed } from "util/keyUtils";
6262
import{defaultLayout,GridItemComp,GridItemDataType}from"../gridItemComp";
6363
import{ThemeContext}from"comps/utils/themeContext";
6464
import{defaultTheme}from"@lowcoder-ee/constants/themeConstants";
65+
import{ExpandViewContext}from"../tableComp/expansionControl";
6566

6667
constchildrenMap={
6768
layout:valueComp<Layout>({}),
@@ -357,11 +358,12 @@ export const InnerGrid = React.memo((props: ViewPropsWithSelect) => {
357358
||String(DEFAULT_GRID_COLUMNS);
358359
},[horizontalGridCells,positionParams.cols]);
359360

361+
constisExpandView=useContext(ExpandViewContext);
360362
constisDroppable=
361-
useContext(IsDroppable)&&(_.isNil(props.isDroppable)||props.isDroppable)&&!readOnly;
362-
constisDraggable=!readOnly&&(_.isNil(props.isDraggable)||props.isDraggable);
363-
constisResizable=!readOnly&&(_.isNil(props.isResizable)||props.isResizable);
364-
constisSelectable=!readOnly&&(_.isNil(props.isSelectable)||props.isSelectable);
363+
useContext(IsDroppable)&&(_.isNil(props.isDroppable)||props.isDroppable)&&!readOnly&&!isExpandView;
364+
constisDraggable=!readOnly&&!isExpandView&&(_.isNil(props.isDraggable)||props.isDraggable);
365+
constisResizable=!readOnly&&!isExpandView&&(_.isNil(props.isResizable)||props.isResizable);
366+
constisSelectable=!readOnly&&!isExpandView&&(_.isNil(props.isSelectable)||props.isSelectable);
365367
constextraLayout=useMemo(
366368
()=>
367369
getExtraLayout(

‎client/packages/lowcoder/src/comps/comps/tableComp/expansionControl.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
1111
import{trans}from"i18n";
1212
import_from"lodash";
1313
import{ConstructorToView,wrapChildAction}from"lowcoder-core";
14-
import{useContext}from"react";
14+
import{createContext,useContext}from"react";
1515
import{tryToNumber}from"util/convertUtils";
1616
import{SimpleContainerComp}from"../containerBase/simpleContainerComp";
1717
import{OB_ROW_ORI_INDEX,RecordType}from"./tableUtils";
1818
import{NameGenerator}from"comps/utils";
1919
import{JSONValue}from"util/jsonTypes";
2020

2121
constContextSlotControl=withSelectedMultiContext(SlotControl);
22+
exportconstExpandViewContext=createContext(false);
2223

2324
constContainerView=(props:ContainerBaseProps)=>{
2425
return<InnerGrid{...props}emptyRows={15}autoHeight/>;
@@ -85,7 +86,11 @@ export class ExpansionControl extends ExpansionControlTmp {
8586
String(record[OB_ROW_ORI_INDEX])
8687
);
8788
constcontainerProps=slotControl.children.container.getView();
88-
return<ExpandViewkey={record[OB_ROW_ORI_INDEX]}containerProps={containerProps}/>;
89+
return(
90+
<ExpandViewContext.Providervalue={true}>
91+
<ExpandViewkey={record[OB_ROW_ORI_INDEX]}containerProps={containerProps}/>
92+
</ExpandViewContext.Provider>
93+
);
8994
},
9095
},
9196
expandModalView:selectedContainer.getView(),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp