@dhis2-ui/select 10.7.6 → 10.7.8

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.
@@ -114,7 +114,6 @@ class Select extends _react.Component {
114
114
  if (e.defaultPrevented) {
115
115
  return;
116
116
  }
117
- e.stopPropagation();
118
117
  const {
119
118
  open
120
119
  } = this.state;
@@ -123,6 +122,13 @@ class Select extends _react.Component {
123
122
  } = e;
124
123
  const shouldOpen = !open && (keyCode === SPACE_KEY || keyCode === UP_KEY || keyCode === DOWN_KEY);
125
124
  const shouldClose = open && keyCode === ESCAPE_KEY;
125
+
126
+ /* Do not block event propagation when the Select is closed unless
127
+ * the key to open it is pressed, so that other components like
128
+ * the Modal can still respond to keypresses (i.e. ESC to close) */
129
+ if (open || shouldOpen) {
130
+ e.stopPropagation();
131
+ }
126
132
  if (shouldClose) {
127
133
  return this.handleClose();
128
134
  }
@@ -106,7 +106,6 @@ export class Select extends Component {
106
106
  if (e.defaultPrevented) {
107
107
  return;
108
108
  }
109
- e.stopPropagation();
110
109
  const {
111
110
  open
112
111
  } = this.state;
@@ -115,6 +114,13 @@ export class Select extends Component {
115
114
  } = e;
116
115
  const shouldOpen = !open && (keyCode === SPACE_KEY || keyCode === UP_KEY || keyCode === DOWN_KEY);
117
116
  const shouldClose = open && keyCode === ESCAPE_KEY;
117
+
118
+ /* Do not block event propagation when the Select is closed unless
119
+ * the key to open it is pressed, so that other components like
120
+ * the Modal can still respond to keypresses (i.e. ESC to close) */
121
+ if (open || shouldOpen) {
122
+ e.stopPropagation();
123
+ }
118
124
  if (shouldClose) {
119
125
  return this.handleClose();
120
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/select",
3
- "version": "10.7.6",
3
+ "version": "10.7.8",
4
4
  "description": "UI Select",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,21 +33,21 @@
33
33
  "styled-jsx": "^4"
34
34
  },
35
35
  "dependencies": {
36
- "@dhis2-ui/box": "10.7.6",
37
- "@dhis2-ui/button": "10.7.6",
38
- "@dhis2-ui/card": "10.7.6",
39
- "@dhis2-ui/checkbox": "10.7.6",
40
- "@dhis2-ui/chip": "10.7.6",
41
- "@dhis2-ui/field": "10.7.6",
42
- "@dhis2-ui/input": "10.7.6",
43
- "@dhis2-ui/layer": "10.7.6",
44
- "@dhis2-ui/loader": "10.7.6",
45
- "@dhis2-ui/popper": "10.7.6",
46
- "@dhis2-ui/status-icon": "10.7.6",
47
- "@dhis2-ui/tooltip": "10.7.6",
36
+ "@dhis2-ui/box": "10.7.8",
37
+ "@dhis2-ui/button": "10.7.8",
38
+ "@dhis2-ui/card": "10.7.8",
39
+ "@dhis2-ui/checkbox": "10.7.8",
40
+ "@dhis2-ui/chip": "10.7.8",
41
+ "@dhis2-ui/field": "10.7.8",
42
+ "@dhis2-ui/input": "10.7.8",
43
+ "@dhis2-ui/layer": "10.7.8",
44
+ "@dhis2-ui/loader": "10.7.8",
45
+ "@dhis2-ui/popper": "10.7.8",
46
+ "@dhis2-ui/status-icon": "10.7.8",
47
+ "@dhis2-ui/tooltip": "10.7.8",
48
48
  "@dhis2/prop-types": "^3.1.2",
49
- "@dhis2/ui-constants": "10.7.6",
50
- "@dhis2/ui-icons": "10.7.6",
49
+ "@dhis2/ui-constants": "10.7.8",
50
+ "@dhis2/ui-icons": "10.7.8",
51
51
  "classnames": "^2.3.1",
52
52
  "prop-types": "^15.7.2"
53
53
  },