Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
49d5daeb
Commit
49d5daeb
authored
Jul 03, 2020
by
zhangwenshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mouseleave bug
parent
95873264
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
DragFixed.tsx
components/apolloTable/component/DragFixed.tsx
+11
-18
No files found.
components/apolloTable/component/DragFixed.tsx
View file @
49d5daeb
...
...
@@ -27,23 +27,11 @@ const DragFixed = (props: any) => {
handle
.
style
.
top
=
`
${
e
.
clientY
}
px`
;
};
const
onMouseLeaveWrap
=
(
e
:
any
)
=>
{
const
originLeft
=
container
.
getBoundingClientRect
().
x
||
0
;
// 当前固定列宽度为分割线的left
const
handleWrapLeft
:
string
=
handleWrap
.
style
.
left
;
// 样式转数值
const
handleWrapLeftNum
:
string
=
handleWrapLeft
.
slice
(
0
,
-
2
);
console
.
log
(
'x'
,
e
.
clientX
-
originLeft
)
console
.
log
(
'left'
,
handleWrapLeftNum
)
if
(
e
.
clientX
-
originLeft
<
Number
(
handleWrapLeftNum
)
-
10
||
e
.
clientX
-
originLeft
>
Number
(
handleWrapLeftNum
)
+
12
)
{
// 滑块wrap移除hovered样式
handleWrap
.
classList
.
remove
(
styles
.
hovered
);
// 滑块隐藏
handle
.
style
.
opacity
=
0
;
}
const
onMouseLeaveWrap
=
()
=>
{
// 滑块wrap移除hovered样式
handleWrap
.
classList
.
remove
(
styles
.
hovered
);
// 滑块隐藏
handle
.
style
.
opacity
=
0
;
};
const
onResizeStartHandle
=
(
e
:
any
)
=>
{
...
...
@@ -86,6 +74,11 @@ const DragFixed = (props: any) => {
divider
.
style
.
left
=
`
${
leftHandleLeft
}
px`
;
// 拖动线取鼠标位置
handleWrap
.
style
.
left
=
`
${
inTableLeft
}
px`
;
// 滑动过程中滑块始终显示
// 滑块wrap添加hovered样式
handleWrap
.
classList
.
add
(
styles
.
hovered
);
// 滑块初始化位置,显示
handle
.
style
.
opacity
=
1
;
};
const
onResizeStopHandle
=
()
=>
{
...
...
@@ -139,7 +132,7 @@ const DragFixed = (props: any) => {
}
}
onMouseEnter=
{
onMouseEnterWrap
}
onMouseMove=
{
onMouseMoveWrap
}
//
onMouseLeave={onMouseLeaveWrap}
onMouseLeave=
{
onMouseLeaveWrap
}
>
<
ResizableBox
handle=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment