@atlaskit/react-select 2.4.2 → 2.4.3

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,13 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 2.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#143201](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143201)
8
+ [`8995008d9cff5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8995008d9cff5) -
9
+ Improve assistive technology support for Async loading.
10
+
3
11
  ## 2.4.2
4
12
 
5
13
  ### Patch Changes
@@ -120,6 +120,9 @@ var LiveRegion = function LiveRegion(props) {
120
120
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
121
121
  var ariaResults = (0, _react.useMemo)(function () {
122
122
  var resultsMsg = '';
123
+ if (isLoading) {
124
+ resultsMsg = 'Loading. ';
125
+ }
123
126
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
124
127
  var resultsMessage = screenReaderStatus({
125
128
  count: focusableOptions.length
@@ -129,6 +132,9 @@ var LiveRegion = function LiveRegion(props) {
129
132
  resultsMessage: resultsMessage
130
133
  });
131
134
  }
135
+ if (options && options.length === 0) {
136
+ resultsMsg = 'No options. ';
137
+ }
132
138
  return resultsMsg;
133
139
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
134
140
  var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
@@ -125,6 +125,9 @@ var LiveRegion = function LiveRegion(props) {
125
125
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
126
126
  var ariaResults = (0, _react.useMemo)(function () {
127
127
  var resultsMsg = '';
128
+ if (isLoading) {
129
+ resultsMsg = 'Loading. ';
130
+ }
128
131
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
129
132
  var resultsMessage = screenReaderStatus({
130
133
  count: focusableOptions.length
@@ -134,6 +137,9 @@ var LiveRegion = function LiveRegion(props) {
134
137
  resultsMessage: resultsMessage
135
138
  });
136
139
  }
140
+ if (options && options.length === 0) {
141
+ resultsMsg = 'No options. ';
142
+ }
137
143
  return resultsMsg;
138
144
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
139
145
  var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
@@ -114,6 +114,9 @@ const LiveRegion = props => {
114
114
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
115
115
  const ariaResults = useMemo(() => {
116
116
  let resultsMsg = '';
117
+ if (isLoading) {
118
+ resultsMsg = 'Loading. ';
119
+ }
117
120
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
118
121
  const resultsMessage = screenReaderStatus({
119
122
  count: focusableOptions.length
@@ -123,6 +126,9 @@ const LiveRegion = props => {
123
126
  resultsMessage
124
127
  });
125
128
  }
129
+ if (options && options.length === 0) {
130
+ resultsMsg = 'No options. ';
131
+ }
126
132
  return resultsMsg;
127
133
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
128
134
  const isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
@@ -123,6 +123,9 @@ const LiveRegion = props => {
123
123
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
124
124
  const ariaResults = useMemo(() => {
125
125
  let resultsMsg = '';
126
+ if (isLoading) {
127
+ resultsMsg = 'Loading. ';
128
+ }
126
129
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
127
130
  const resultsMessage = screenReaderStatus({
128
131
  count: focusableOptions.length
@@ -132,6 +135,9 @@ const LiveRegion = props => {
132
135
  resultsMessage
133
136
  });
134
137
  }
138
+ if (options && options.length === 0) {
139
+ resultsMsg = 'No options. ';
140
+ }
135
141
  return resultsMsg;
136
142
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
137
143
  const isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
@@ -111,6 +111,9 @@ var LiveRegion = function LiveRegion(props) {
111
111
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
112
112
  var ariaResults = useMemo(function () {
113
113
  var resultsMsg = '';
114
+ if (isLoading) {
115
+ resultsMsg = 'Loading. ';
116
+ }
114
117
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
115
118
  var resultsMessage = screenReaderStatus({
116
119
  count: focusableOptions.length
@@ -120,6 +123,9 @@ var LiveRegion = function LiveRegion(props) {
120
123
  resultsMessage: resultsMessage
121
124
  });
122
125
  }
126
+ if (options && options.length === 0) {
127
+ resultsMsg = 'No options. ';
128
+ }
123
129
  return resultsMsg;
124
130
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
125
131
  var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
@@ -120,6 +120,9 @@ var LiveRegion = function LiveRegion(props) {
120
120
  }, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
121
121
  var ariaResults = useMemo(function () {
122
122
  var resultsMsg = '';
123
+ if (isLoading) {
124
+ resultsMsg = 'Loading. ';
125
+ }
123
126
  if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
124
127
  var resultsMessage = screenReaderStatus({
125
128
  count: focusableOptions.length
@@ -129,6 +132,9 @@ var LiveRegion = function LiveRegion(props) {
129
132
  resultsMessage: resultsMessage
130
133
  });
131
134
  }
135
+ if (options && options.length === 0) {
136
+ resultsMsg = 'No options. ';
137
+ }
132
138
  return resultsMsg;
133
139
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
134
140
  var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
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",