itsa-react-select 16.0.11 → 16.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component.jsx +18 -10
- package/package.json +2 -2
package/lib/component.jsx
CHANGED
|
@@ -138,16 +138,22 @@ class Select extends React.Component {
|
|
|
138
138
|
instance.setState({
|
|
139
139
|
expanded: newExpanded,
|
|
140
140
|
btnPressed: true
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
instance.
|
|
148
|
-
instance.setState({btnPressed: false});
|
|
149
|
-
}, DEF_BUTTON_PRESS_TIME);
|
|
141
|
+
}, () => {
|
|
142
|
+
instance._removeTimer && instance._removeTimer.cancel();
|
|
143
|
+
if (newExpanded) {
|
|
144
|
+
instance._focusContainer.focusActiveElement();
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
instance.focus(true, BTN_REFOCES_TRANS_TIME);
|
|
150
148
|
}
|
|
149
|
+
// need to go async --> handleClick goes so quick, that is is before handleMouseDown
|
|
150
|
+
async(() => {
|
|
151
|
+
if (!instance._mouseDown && !simulatedClick) {
|
|
152
|
+
instance._removeTimer = later(() => {
|
|
153
|
+
instance.setState({btnPressed: false});
|
|
154
|
+
}, DEF_BUTTON_PRESS_TIME);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
151
157
|
});
|
|
152
158
|
}
|
|
153
159
|
}
|
|
@@ -226,7 +232,8 @@ class Select extends React.Component {
|
|
|
226
232
|
keyCode = e.keyCode;
|
|
227
233
|
|
|
228
234
|
if (!props.disabled && !props.readOnly && !instance._buttonDown) {
|
|
229
|
-
if ((keyCode===27) && (state.expanded)) {
|
|
235
|
+
// if ((keyCode===27) && (state.expanded)) {
|
|
236
|
+
if (((keyCode===27) || (keyCode===8) || (keyCode===9)) && (state.expanded)) {
|
|
230
237
|
instance.setState({
|
|
231
238
|
expanded: false
|
|
232
239
|
});
|
|
@@ -390,6 +397,7 @@ class Select extends React.Component {
|
|
|
390
397
|
<div className={containerClass} onKeyDown={itemScroll}>
|
|
391
398
|
<FocusContainer
|
|
392
399
|
className={containerSubClass}
|
|
400
|
+
enterKey={13}
|
|
393
401
|
keyDown={40}
|
|
394
402
|
keyUp={38}
|
|
395
403
|
loop={props.loop}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "itsa-react-select",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.13",
|
|
4
4
|
"description": "Nice select for react",
|
|
5
5
|
"author": [
|
|
6
6
|
{
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"itsa-dom": "^1.2.2",
|
|
37
37
|
"itsa-react-button": "^16.0.10",
|
|
38
38
|
"itsa-react-clone-props": "^1.1.1",
|
|
39
|
-
"itsa-react-focuscontainer": "^16.0.
|
|
39
|
+
"itsa-react-focuscontainer": "^16.0.9",
|
|
40
40
|
"itsa-utils": "^1.4.1",
|
|
41
41
|
"prop-types": "^15.5.10"
|
|
42
42
|
},
|