Skip to content

Commit dcf4fa0

Browse files
author
FalkWolsky
committed
Fixing word wrap in Table
1 parent 7071777 commit dcf4fa0

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

client/packages/lowcoder/src/components/table/columnTypeView.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ const ColumnTypeViewWrapper = styled.div<{
55
$textOverflow?: boolean
66
}>`
77
position: relative;
8-
${props => !props.$textOverflow && `
8+
${props => props.$textOverflow == false && `
99
div {
1010
overflow: hidden;
1111
white-space: nowrap;
1212
text-overflow: ellipsis;
1313
word-break: keep-all;
1414
}
15+
span {
16+
display: inline-block; /* Change display to inline-block for span */
17+
overflow: hidden;
18+
white-space: nowrap;
19+
text-overflow: ellipsis;
20+
word-break: keep-all;
21+
}
1522
`}
1623
`;
1724

@@ -71,6 +78,9 @@ export default function ColumnTypeView(props: {
7178
children: React.ReactNode,
7279
textOverflow?: boolean,
7380
}) {
81+
82+
console.log("ColumnTypeView.textOverflow", props.textOverflow);
83+
7484
const wrapperRef = useRef<HTMLDivElement>(null);
7585
const hoverViewRef = useRef<HTMLDivElement>(null);
7686
const [isHover, setIsHover] = useState(false);

client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps/columnStatusComp.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ type StatusEditPropsType = {
4747
const StatusEdit = (props: StatusEditPropsType) => {
4848
const defaultStatus = useContext(StatusContext);
4949
const [status, setStatus] = useState(defaultStatus);
50+
const [allOptions, setAllOptions] = useState(BadgeStatusOptions);
5051
const [open, setOpen] = useState(true);
52+
5153
return (
5254
<Wrapper>
5355
<CustomSelect
@@ -97,12 +99,12 @@ const StatusEdit = (props: StatusEditPropsType) => {
9799
}}
98100
onClick={() => setOpen(!open)}
99101
>
100-
{status.map((value, index) => (
101-
<CustomSelect.Option value={value.text} key={index}>
102-
{value.status === "none" ? (
103-
value.text
102+
{allOptions.map((value, index) => (
103+
<CustomSelect.Option value={value} key={index}>
104+
{value === "none" ? (
105+
value
104106
) : (
105-
<Badge status={value.status} text={value.text} />
107+
<Badge status={value} text={value} />
106108
)}
107109
</CustomSelect.Option>
108110
))}
@@ -117,7 +119,7 @@ export const BadgeStatusComp = (function () {
117119
(props, dispatch) => {
118120
const text = props.changeValue?.value ?? getBaseValue(props, dispatch).value;
119121
const status = props.changeValue?.status ?? getBaseValue(props, dispatch).status;
120-
return status === "none" ? text : <Badge status={status} text={text} />;
122+
return status === "none" ? text : <Badge status={status} text={text}/>;
121123
},
122124
(nodeValue) => [nodeValue.status.value, nodeValue.text.value].filter((t) => t).join(" "),
123125
getBaseValue

0 commit comments

Comments
 (0)