Skip to content

Commit 9fa804c

Browse files
committed
Fix scroll bug with focusing filter input
1 parent ae79b80 commit 9fa804c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

dev/dev.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ var App = React.createClass({
210210

211211
return (
212212
<div style={{ fontSize: 14 }}>
213-
<div style={{ maxWidth: 600 }}>
213+
<div style={{ maxWidth: 600, height: 1500 }}>
214214
<section className="example" style={{ marginBottom: 20 }}>
215215
<DropdownList
216216
placeholder='hi...'

src/DropdownList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ var DropdownList = React.createClass({
168168
}
169169
</div>
170170
<Popup {..._.pick(this.props, Object.keys(compat.type(Popup).propTypes))}
171-
onOpening={() => (this.refs.list.forceUpdate(), this.focus())}
171+
onOpen={this.focus}
172+
onOpening={() => this.refs.list.forceUpdate() }
172173
onRequestClose={this.close}>
173174

174175
<div>

src/mixins/PopupScrollToMixin.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module.exports = {
1616
changed = lastItem !== focused
1717
shown = state.visible && !lastVisible
1818

19-
if ( shown || (state.visible && changed) ){
20-
if ( handler )
21-
handler(selected, list, focused)
22-
else {
23-
state.scrollCancel && state.scrollCancel()
24-
state.scrollCancel = scrollTo(selected, list)
25-
}
26-
}
19+
// if ( shown || (state.visible && changed) ){
20+
// if ( handler )
21+
// handler(selected, list, focused)
22+
// else {
23+
// state.scrollCancel && state.scrollCancel()
24+
// state.scrollCancel = scrollTo(selected, list)
25+
// }
26+
// }
2727
},
2828
}

0 commit comments

Comments
 (0)