@availity/feedback 6.2.1 → 6.2.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.2.5](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.4...@availity/feedback@6.2.5) (2021-12-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **feedback:** added keyDown for tabbing out to close dropdown ([afa0ce8](https://github.com/Availity/availity-react/commit/afa0ce8d6c4116a1c6ede611025bf2c794129d8b))
12
+ * **feedback:** removed console log ([df6b146](https://github.com/Availity/availity-react/commit/df6b146ae66560777d797c0399dbf9b2db189e47))
13
+
14
+
15
+
16
+
17
+
18
+ ## [6.2.4](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.3...@availity/feedback@6.2.4) (2021-11-30)
19
+
20
+ **Note:** Version bump only for package @availity/feedback
21
+
22
+
23
+
24
+
25
+
26
+ ## [6.2.3](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.2...@availity/feedback@6.2.3) (2021-11-19)
27
+
28
+ **Note:** Version bump only for package @availity/feedback
29
+
30
+
31
+
32
+
33
+
34
+ ## [6.2.2](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.1...@availity/feedback@6.2.2) (2021-11-16)
35
+
36
+ **Note:** Version bump only for package @availity/feedback
37
+
38
+
39
+
40
+
41
+
6
42
  ## [6.2.1](https://github.com/Availity/availity-react/compare/@availity/feedback@6.2.0...@availity/feedback@6.2.1) (2021-11-15)
7
43
 
8
44
  **Note:** Version bump only for package @availity/feedback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/feedback",
3
- "version": "6.2.1",
3
+ "version": "6.2.5",
4
4
  "author": "Evan Sharp <evan.sharp@availity.com>",
5
5
  "description": "Availity feedback with smiley faces react component.",
6
6
  "main": "index.js",
@@ -21,11 +21,11 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@availity/form": "^1.2.0",
24
+ "@availity/form": "^1.2.1",
25
25
  "@availity/hooks": "^3.1.0",
26
26
  "@availity/icon": "^0.10.0",
27
27
  "@availity/native-form": "^4.0.5",
28
- "@availity/select": "^2.1.1",
28
+ "@availity/select": "^2.2.1",
29
29
  "prop-types": "^15.7.2"
30
30
  },
31
31
  "devDependencies": {
@@ -47,5 +47,5 @@
47
47
  "reactstrap": "^8.0.0 || ^7.0.0 || ^6.0.0",
48
48
  "yup": "^0.27.0"
49
49
  },
50
- "gitHead": "1a73654e3e58572b4bec5afc8170566c1a6dd81e"
50
+ "gitHead": "7b5ca991164f070868efc05e4cef007b16e0c7ca"
51
51
  }
@@ -151,6 +151,7 @@ const FeedbackForm = ({
151
151
  options={faceOptions}
152
152
  name="smileField"
153
153
  onChange={(option) => setActive(option)}
154
+ onClose={onClose}
154
155
  autoFocusFeedbackButton={autoFocusFeedbackButton}
155
156
  />
156
157
  </FormGroup>
@@ -206,12 +207,32 @@ const FeedbackForm = ({
206
207
  ) : null}
207
208
 
208
209
  {onClose ? (
209
- <Button onClick={onClose} color="secondary" onKeyDown={({ keyCode }) => keyCode === 13 && onClose()}>
210
+ <Button
211
+ onClick={onClose}
212
+ color="secondary"
213
+ onKeyDown={({ keyCode }) => {
214
+ if (keyCode === 13) {
215
+ onClose();
216
+ }
217
+ if (keyCode === 9 && !active) {
218
+ onClose();
219
+ }
220
+ }}
221
+ >
210
222
  Close
211
223
  </Button>
212
224
  ) : null}
213
225
 
214
- <Button type="submit" color="primary" disabled={!active}>
226
+ <Button
227
+ onKeyDown={({ keyCode }) => {
228
+ if (keyCode === 9) {
229
+ onClose();
230
+ }
231
+ }}
232
+ type="submit"
233
+ color="primary"
234
+ disabled={!active}
235
+ >
215
236
  Send Feedback
216
237
  </Button>
217
238
  </ModalFooter>
package/src/SmileField.js CHANGED
@@ -5,13 +5,24 @@ import FeedbackButton from './FeedbackButton';
5
5
 
6
6
  const btnStyles = { flex: 1, margin: '0 2% 0 2%' };
7
7
 
8
- const SmileField = ({ name, options, onChange, autoFocusFeedbackButton }) => {
8
+ const SmileField = ({ name, options, onChange, autoFocusFeedbackButton, onClose }) => {
9
9
  const [{ value }] = useField(name);
10
10
  const { setFieldValue } = useFormikContext();
11
11
 
12
12
  return options.map((option, i) => (
13
13
  <FeedbackButton
14
14
  autoFocus={i === 0 && autoFocusFeedbackButton}
15
+ onKeyDown={(e) => {
16
+ if (e.shiftKey && e.keyCode === 9 && i === 0) {
17
+ onClose();
18
+ }
19
+ if (e.keyCode === 13) {
20
+ setFieldValue(name, option);
21
+ if (onChange) {
22
+ onChange(option);
23
+ }
24
+ }
25
+ }}
15
26
  style={btnStyles}
16
27
  key={option.icon}
17
28
  icon={option.icon}