File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " rc-drawer-menu" ,
3
- "version" : " 0.5.1 " ,
3
+ "version" : " 0.5.2 " ,
4
4
"description" : " drawer menu animation component for react" ,
5
5
"keywords" : [
6
6
" react" ,
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class Drawer extends React.PureComponent {
41
41
42
42
contextDom = null ;
43
43
contextWrapDom = null ;
44
+ maskDom = null ;
44
45
45
46
mousePos = null ;
46
47
@@ -155,7 +156,7 @@ class Drawer extends React.PureComponent {
155
156
if ( ( d . scrollHeight > d . clientHeight || d . scrollWidth > d . clientWidth ) ) {
156
157
doms . push ( d ) ;
157
158
}
158
- if ( d !== this . contextDom ) {
159
+ if ( d !== this . contextDom && d !== this . maskDom ) {
159
160
setScrollDom ( d . parentNode ) ;
160
161
}
161
162
} ;
@@ -176,7 +177,7 @@ class Drawer extends React.PureComponent {
176
177
removeScroll = ( e ) => {
177
178
const dom = e . target ;
178
179
const scrollDom = this . getScollDom ( dom ) ;
179
- if ( dom . className === ` ${ this . props . className } -bg` || this . getIsButtonDom ( dom ) || ! scrollDom ) {
180
+ if ( dom === this . maskDom || this . getIsButtonDom ( dom ) || ! scrollDom ) {
180
181
e . preventDefault ( ) ;
181
182
e . returnValue = false ;
182
183
return ;
@@ -275,6 +276,9 @@ class Drawer extends React.PureComponent {
275
276
< div
276
277
className = { `${ className } -bg` }
277
278
onClick = { this . onMaskTouchEnd }
279
+ ref = { ( c ) => {
280
+ this . maskDom = c ;
281
+ } }
278
282
/>
279
283
< div
280
284
className = { `${ className } -content-wrapper` }
You can’t perform that action at this time.
0 commit comments