Skip to content

Commit b7dadcb

Browse files
committedMar 20, 2025
don't select children text on double click
1 parent 3b0fb50 commit b7dadcb

File tree

1 file changed

+9
-8
lines changed
  • packages/web-console/src/scenes/Schema/Row

1 file changed

+9
-8
lines changed
 

‎packages/web-console/src/scenes/Schema/Row/index.tsx

+9-8
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,25 @@ const Type = styled(Text)`
7070
transition: opacity ${TransitionDuration.REG}ms;
7171
`
7272

73-
const Title = styled(Text)<TextProps & { kind: TreeNodeKind }>`
74-
cursor: ${({ kind }) =>
75-
["folder", "table", "matview"].includes(kind) ? "pointer" : "initial"};
76-
73+
const Title = styled(Text)`
7774
.highlight {
7875
background-color: #7c804f;
7976
color: ${({ theme }) => theme.color.foreground};
8077
}
8178
`
8279

83-
const Wrapper = styled.div`
80+
const Wrapper = styled.div<{ $isExpandable: boolean }>`
8481
position: relative;
8582
display: flex;
8683
flex-direction: column;
8784
padding: 0.5rem 0;
8885
padding-left: 1rem;
8986
padding-right: 1rem;
9087
transition: background ${TransitionDuration.REG}ms;
88+
user-select: none;
89+
${({ $isExpandable }) => $isExpandable && `
90+
cursor: pointer;
91+
`}
9192
9293
&:hover,
9394
&:active {
@@ -103,8 +104,8 @@ const StyledTitle = styled(Title)`
103104
flex-shrink: 0;
104105
margin-right: 1rem;
105106
106-
mark {
107-
background-color: #45475a !important;
107+
.highlight {
108+
background-color: #45475a;
108109
color: ${({ theme }) => theme.color.foreground};
109110
}
110111
`
@@ -230,6 +231,7 @@ const Row = ({
230231

231232
return (
232233
<Wrapper
234+
$isExpandable={isExpandable}
233235
data-hook={dataHook ?? "schema-row"}
234236
className={className}
235237
onClick={(e) => {
@@ -281,7 +283,6 @@ const Row = ({
281283
<StyledTitle
282284
color="foreground"
283285
ellipsis
284-
kind={kind}
285286
data-hook={`schema-${kind}-title`}
286287
>
287288
{isTableKind && (

0 commit comments

Comments
 (0)
Failed to load comments.