@atlaskit/react-select 3.4.3 → 3.4.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
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 3.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.4.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4129d4df5bb4d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4129d4df5bb4d) -
14
+ Revert the changes done to add prop hasOtherFocusableElements flag
15
+
3
16
  ## 3.4.3
4
17
 
5
18
  ### Patch Changes
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/async.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/async.d.ts"
14
14
  ]
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/async-creatable.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/async-creatable.d.ts"
14
14
  ]
package/base/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/select.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/select.d.ts"
14
14
  ]
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/creatable.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/creatable.d.ts"
14
14
  ]
@@ -52,7 +52,6 @@ var defaultProps = exports.defaultProps = {
52
52
  isMulti: false,
53
53
  isRtl: false,
54
54
  isSearchable: true,
55
- hasOtherFocusableElements: false,
56
55
  isOptionDisabled: _builtins.isOptionDisabled,
57
56
  loadingMessage: function loadingMessage() {
58
57
  return 'Loading...';
@@ -258,7 +257,6 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
258
257
  (0, _defineProperty2.default)(_this, "initialTouchY", 0);
259
258
  (0, _defineProperty2.default)(_this, "openAfterFocus", false);
260
259
  (0, _defineProperty2.default)(_this, "scrollToFocusedOptionOnUpdate", false);
261
- (0, _defineProperty2.default)(_this, "lastPressedKey", '');
262
260
  // Refs
263
261
  // ------------------------------
264
262
  (0, _defineProperty2.default)(_this, "controlRef", null);
@@ -640,9 +638,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
640
638
  return;
641
639
  }
642
640
  if (_this.props.onBlur) {
643
- if (!_this.props.hasOtherFocusableElements || _this.props.hasOtherFocusableElements && _this.lastPressedKey !== 'Tab') {
644
- _this.props.onBlur(event);
645
- }
641
+ _this.props.onBlur(event);
646
642
  }
647
643
  _this.onInputChange('', {
648
644
  action: 'input-blur',
@@ -708,9 +704,6 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
708
704
  return;
709
705
  }
710
706
  }
711
- if (_this.props.hasOtherFocusableElements) {
712
- _this.lastPressedKey = event.key;
713
- }
714
707
 
715
708
  // Block option hover events when the user has just pressed a key
716
709
  _this.blockOptionHover = true;
@@ -936,15 +929,11 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
936
929
  }, {
937
930
  key: "onMenuClose",
938
931
  value: function onMenuClose() {
939
- if (!this.props.hasOtherFocusableElements || this.props.hasOtherFocusableElements && this.lastPressedKey !== 'Tab') {
940
- this.onInputChange('', {
941
- action: 'menu-close',
942
- prevInputValue: this.props.inputValue
943
- });
944
- this.props.onMenuClose();
945
- } else {
946
- this.lastPressedKey = '';
947
- }
932
+ this.onInputChange('', {
933
+ action: 'menu-close',
934
+ prevInputValue: this.props.inputValue
935
+ });
936
+ this.props.onMenuClose();
948
937
  }
949
938
  }, {
950
939
  key: "onInputChange",
@@ -31,7 +31,6 @@ export const defaultProps = {
31
31
  isMulti: false,
32
32
  isRtl: false,
33
33
  isSearchable: true,
34
- hasOtherFocusableElements: false,
35
34
  isOptionDisabled: isOptionDisabledBuiltin,
36
35
  loadingMessage: () => 'Loading...',
37
36
  maxMenuHeight: 300,
@@ -227,7 +226,6 @@ export default class Select extends Component {
227
226
  _defineProperty(this, "initialTouchY", 0);
228
227
  _defineProperty(this, "openAfterFocus", false);
229
228
  _defineProperty(this, "scrollToFocusedOptionOnUpdate", false);
230
- _defineProperty(this, "lastPressedKey", '');
231
229
  // Refs
232
230
  // ------------------------------
233
231
  _defineProperty(this, "controlRef", null);
@@ -613,9 +611,7 @@ export default class Select extends Component {
613
611
  return;
614
612
  }
615
613
  if (this.props.onBlur) {
616
- if (!this.props.hasOtherFocusableElements || this.props.hasOtherFocusableElements && this.lastPressedKey !== 'Tab') {
617
- this.props.onBlur(event);
618
- }
614
+ this.props.onBlur(event);
619
615
  }
620
616
  this.onInputChange('', {
621
617
  action: 'input-blur',
@@ -683,9 +679,6 @@ export default class Select extends Component {
683
679
  return;
684
680
  }
685
681
  }
686
- if (this.props.hasOtherFocusableElements) {
687
- this.lastPressedKey = event.key;
688
- }
689
682
 
690
683
  // Block option hover events when the user has just pressed a key
691
684
  this.blockOptionHover = true;
@@ -968,15 +961,11 @@ export default class Select extends Component {
968
961
  this.props.onMenuOpen();
969
962
  }
970
963
  onMenuClose() {
971
- if (!this.props.hasOtherFocusableElements || this.props.hasOtherFocusableElements && this.lastPressedKey !== 'Tab') {
972
- this.onInputChange('', {
973
- action: 'menu-close',
974
- prevInputValue: this.props.inputValue
975
- });
976
- this.props.onMenuClose();
977
- } else {
978
- this.lastPressedKey = '';
979
- }
964
+ this.onInputChange('', {
965
+ action: 'menu-close',
966
+ prevInputValue: this.props.inputValue
967
+ });
968
+ this.props.onMenuClose();
980
969
  }
981
970
  onInputChange(newValue, actionMeta) {
982
971
  this.props.onInputChange(newValue, actionMeta);
@@ -43,7 +43,6 @@ export var defaultProps = {
43
43
  isMulti: false,
44
44
  isRtl: false,
45
45
  isSearchable: true,
46
- hasOtherFocusableElements: false,
47
46
  isOptionDisabled: isOptionDisabledBuiltin,
48
47
  loadingMessage: function loadingMessage() {
49
48
  return 'Loading...';
@@ -249,7 +248,6 @@ var Select = /*#__PURE__*/function (_Component) {
249
248
  _defineProperty(_this, "initialTouchY", 0);
250
249
  _defineProperty(_this, "openAfterFocus", false);
251
250
  _defineProperty(_this, "scrollToFocusedOptionOnUpdate", false);
252
- _defineProperty(_this, "lastPressedKey", '');
253
251
  // Refs
254
252
  // ------------------------------
255
253
  _defineProperty(_this, "controlRef", null);
@@ -631,9 +629,7 @@ var Select = /*#__PURE__*/function (_Component) {
631
629
  return;
632
630
  }
633
631
  if (_this.props.onBlur) {
634
- if (!_this.props.hasOtherFocusableElements || _this.props.hasOtherFocusableElements && _this.lastPressedKey !== 'Tab') {
635
- _this.props.onBlur(event);
636
- }
632
+ _this.props.onBlur(event);
637
633
  }
638
634
  _this.onInputChange('', {
639
635
  action: 'input-blur',
@@ -699,9 +695,6 @@ var Select = /*#__PURE__*/function (_Component) {
699
695
  return;
700
696
  }
701
697
  }
702
- if (_this.props.hasOtherFocusableElements) {
703
- _this.lastPressedKey = event.key;
704
- }
705
698
 
706
699
  // Block option hover events when the user has just pressed a key
707
700
  _this.blockOptionHover = true;
@@ -927,15 +920,11 @@ var Select = /*#__PURE__*/function (_Component) {
927
920
  }, {
928
921
  key: "onMenuClose",
929
922
  value: function onMenuClose() {
930
- if (!this.props.hasOtherFocusableElements || this.props.hasOtherFocusableElements && this.lastPressedKey !== 'Tab') {
931
- this.onInputChange('', {
932
- action: 'menu-close',
933
- prevInputValue: this.props.inputValue
934
- });
935
- this.props.onMenuClose();
936
- } else {
937
- this.lastPressedKey = '';
938
- }
923
+ this.onInputChange('', {
924
+ action: 'menu-close',
925
+ prevInputValue: this.props.inputValue
926
+ });
927
+ this.props.onMenuClose();
939
928
  }
940
929
  }, {
941
930
  key: "onInputChange",
@@ -240,10 +240,6 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
240
240
  * Whether to enable search functionality
241
241
  */
242
242
  isSearchable: boolean;
243
- /**
244
- * Indicate whether menu contains other focusable elements, like footer or header
245
- */
246
- hasOtherFocusableElements?: boolean;
247
243
  /**
248
244
  * This sets the aria-label attribute. It sets an accessible name for the select, for people who use assistive technology. Use of a visible label is highly recommended for greater accessibility support.
249
245
  */
@@ -453,7 +449,6 @@ export declare const defaultProps: {
453
449
  isMulti: boolean;
454
450
  isRtl: boolean;
455
451
  isSearchable: boolean;
456
- hasOtherFocusableElements: boolean;
457
452
  isOptionDisabled: <Option>(option: Option) => boolean;
458
453
  loadingMessage: () => string;
459
454
  maxMenuHeight: number;
@@ -533,7 +528,6 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
533
528
  isMulti: boolean;
534
529
  isRtl: boolean;
535
530
  isSearchable: boolean;
536
- hasOtherFocusableElements: boolean;
537
531
  isOptionDisabled: <Option_1>(option: Option_1) => boolean;
538
532
  loadingMessage: () => string;
539
533
  maxMenuHeight: number;
@@ -566,7 +560,6 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
566
560
  openAfterFocus: boolean;
567
561
  scrollToFocusedOptionOnUpdate: boolean;
568
562
  userIsDragging?: boolean;
569
- lastPressedKey?: string;
570
563
  controlRef: HTMLDivElement | null;
571
564
  getControlRef: RefCallback<HTMLDivElement>;
572
565
  focusedOptionRef: HTMLDivElement | null;
@@ -240,10 +240,6 @@ export interface SelectProps<Option, IsMulti extends boolean, Group extends Grou
240
240
  * Whether to enable search functionality
241
241
  */
242
242
  isSearchable: boolean;
243
- /**
244
- * Indicate whether menu contains other focusable elements, like footer or header
245
- */
246
- hasOtherFocusableElements?: boolean;
247
243
  /**
248
244
  * This sets the aria-label attribute. It sets an accessible name for the select, for people who use assistive technology. Use of a visible label is highly recommended for greater accessibility support.
249
245
  */
@@ -453,7 +449,6 @@ export declare const defaultProps: {
453
449
  isMulti: boolean;
454
450
  isRtl: boolean;
455
451
  isSearchable: boolean;
456
- hasOtherFocusableElements: boolean;
457
452
  isOptionDisabled: <Option>(option: Option) => boolean;
458
453
  loadingMessage: () => string;
459
454
  maxMenuHeight: number;
@@ -533,7 +528,6 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
533
528
  isMulti: boolean;
534
529
  isRtl: boolean;
535
530
  isSearchable: boolean;
536
- hasOtherFocusableElements: boolean;
537
531
  isOptionDisabled: <Option_1>(option: Option_1) => boolean;
538
532
  loadingMessage: () => string;
539
533
  maxMenuHeight: number;
@@ -566,7 +560,6 @@ export default class Select<Option = unknown, IsMulti extends boolean = false, G
566
560
  openAfterFocus: boolean;
567
561
  scrollToFocusedOptionOnUpdate: boolean;
568
562
  userIsDragging?: boolean;
569
- lastPressedKey?: string;
570
563
  controlRef: HTMLDivElement | null;
571
564
  getControlRef: RefCallback<HTMLDivElement>;
572
565
  focusedOptionRef: HTMLDivElement | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
4
4
  "description": "A forked version of react-select to only be used in atlaskit/select",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/ds-lib": "^5.0.0",
32
- "@atlaskit/icon": "^27.12.0",
32
+ "@atlaskit/icon": "^28.0.0",
33
33
  "@atlaskit/layering": "^3.0.0",
34
34
  "@atlaskit/platform-feature-flags": "^1.1.0",
35
35
  "@atlaskit/primitives": "^14.11.0",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@atlaskit/checkbox": "^17.1.0",
50
- "@atlaskit/form": "^12.0.0",
50
+ "@atlaskit/form": "^12.1.0",
51
51
  "@atlassian/feature-flags-test-utils": "^0.3.0",
52
52
  "@testing-library/react": "^13.4.0",
53
53
  "@testing-library/user-event": "^14.4.3",
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "types": "../dist/types/types.d.ts",
10
10
  "typesVersions": {
11
- ">=4.5 <5.4": {
11
+ ">=4.5 <5.9": {
12
12
  "*": [
13
13
  "../dist/types-ts4.5/types.d.ts"
14
14
  ]