Skip to content

Commit

Permalink
[fixed] SelectList was too forceful refocusing
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Mar 29, 2016
1 parent 9f954b9 commit 3bd3da4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
22 changes: 14 additions & 8 deletions dev/dev.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var Calendar = require('../src/Calendar.jsx')
var DateTimePicker = require('../lib/DateTimePicker')
var NumberPicker = require('../src/NumberPicker.jsx')
// var ComboBox = require('../src/Combobox.jsx')
// var SelectList = require('../src/SelectList.jsx')
var SelectList = require('../src/SelectList.jsx')
// var List = require('../src/List.jsx')

require('../src/less/react-widgets.less')
Expand Down Expand Up @@ -95,13 +95,19 @@ var App = React.createClass({
>
add
</button>
<DropdownList textField='name'
open={this.state.open}
dropUp={this.state.dropUp}
data={this.state.data}
duration={3000}
filter='startsWith'
/>
<div style={{ height: 300, padding: 20, overflow: 'auto' }}>
<div style={{ height: 150 }}>
<button>add</button>
<input />
</div>
<SelectList
multiple
textField='name'
style={{ height: 'auto', overflow: 'visible'}}
data={this.state.data}
/>
<input />
</div>
</section>
</div>
</div>
Expand Down
7 changes: 2 additions & 5 deletions src/SelectList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ var SelectList = React.createClass({
require('./mixins/RtlParentContextMixin'),
require('./mixins/AriaDescendantMixin')(),
require('./mixins/FocusMixin')({
willHandle(focused) {
if (focused)
this.focus()
},
didHandle(focused) {
// the rigamarole here is to avoid flicker went clicking an item and
// gaining focus at the same time.
Expand Down Expand Up @@ -381,7 +377,8 @@ function getListItem(parent){
</label>
</ListOption>
);
function onMouseDown(e) {

function onMouseDown() {
parent._clicking = true
}

Expand Down
1 change: 1 addition & 0 deletions src/less/selectlist.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
position: relative;
min-height: 27px;
cursor: auto;
outline: none;
padding-left: 5px;

> label > input {
Expand Down

0 comments on commit 3bd3da4

Please sign in to comment.