Skip to content

Commit 9edf5ee

Browse files
committed
fixing Picklist scroll issue
1 parent 620ccf9 commit 9edf5ee

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

components/SLDSPicklistBase/list.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1010
import React, { Component } from 'react';
1111
import {Icon} from "../SLDSIcons";
1212
import ListItem from "./list-item";
13+
import {EventUtil} from '../utils'
1314

1415
module.exports = React.createClass({
1516

@@ -147,6 +148,10 @@ module.exports = React.createClass({
147148
});
148149
},
149150

151+
handleMouseDown (event) {
152+
EventUtil.trapImmediate(event);
153+
},
154+
150155
render () {
151156
return (
152157
<div
@@ -155,6 +160,7 @@ module.exports = React.createClass({
155160
style={{
156161
maxHeight:260
157162
}}
163+
onMouseDown={this.handleMouseDown}
158164
>
159165
<ul
160166
ref="scroll"

components/utils/EventUtil.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ const EventUtil = {
3030
},
3131

3232
trapImmediate(event){
33+
34+
if(event.stopImmediatePropagation){
35+
event.stopImmediatePropagation();
36+
}
37+
3338
if(event.nativeEvent && event.nativeEvent.stopImmediatePropagation){
3439
event.nativeEvent.stopImmediatePropagation();
3540
}
41+
3642
EventUtil.trap(event);
3743
}
3844

0 commit comments

Comments
 (0)