@financial-times/o-autocomplete 1.9.1 → 1.9.2
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 +7 -0
- package/README.md +6 -6
- package/package.json +2 -2
- package/src/js/autocomplete.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.9.2](https://github.com/Financial-Times/origami/compare/o-autocomplete-v1.9.1...o-autocomplete-v1.9.2) (2024-04-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Update financial-times/accessible-autocomplete ([#1524](https://github.com/Financial-Times/origami/issues/1524)) ([8bcd024](https://github.com/Financial-Times/origami/commit/8bcd02402f3fa50e35756d3eb2a22b10435d634b))
|
|
9
|
+
|
|
3
10
|
## [1.9.1](https://github.com/Financial-Times/origami/compare/o-autocomplete-v1.9.0...o-autocomplete-v1.9.1) (2023-10-27)
|
|
4
11
|
|
|
5
12
|
|
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ Or pass an element to initialise a specific `o-autocomplete` instance:
|
|
|
98
98
|
|
|
99
99
|
```js
|
|
100
100
|
import oAutocomplete from 'o-autocomplete';
|
|
101
|
-
const oAutocompleteElement = document.getElementById('
|
|
101
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
102
102
|
new oAutocomplete(oAutocompleteElement);
|
|
103
103
|
```
|
|
104
104
|
### dynamic suggestions function
|
|
@@ -123,7 +123,7 @@ async function customSuggestions(query, populateOptions) {
|
|
|
123
123
|
populateOptions(suggestions);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
const oAutocompleteElement = document.getElementById('
|
|
126
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
127
127
|
new oAutocomplete(oAutocompleteElement, {
|
|
128
128
|
source: customSuggestions
|
|
129
129
|
});
|
|
@@ -176,7 +176,7 @@ function mapOptionToSuggestedValue(option) {
|
|
|
176
176
|
return option.suggestionText;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
const oAutocompleteElement = document.getElementById('
|
|
179
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
180
180
|
new oAutocomplete(oAutocompleteElement, {
|
|
181
181
|
mapOptionToSuggestedValue,
|
|
182
182
|
source: customSuggestions,
|
|
@@ -221,7 +221,7 @@ function onConfirm(option) {
|
|
|
221
221
|
console.log('You selected option: ', option);
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
const oAutocompleteElement = document.getElementById('
|
|
224
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
225
225
|
new oAutocomplete(oAutocompleteElement, {
|
|
226
226
|
onConfirm
|
|
227
227
|
mapOptionToSuggestedValue,
|
|
@@ -260,7 +260,7 @@ function suggestionTemplate(option) {
|
|
|
260
260
|
`;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
const oAutocompleteElement = document.getElementById('
|
|
263
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
264
264
|
new oAutocomplete(oAutocompleteElement, {
|
|
265
265
|
suggestionTemplate,
|
|
266
266
|
source: customSuggestions,
|
|
@@ -305,7 +305,7 @@ function onConfirm(option) {
|
|
|
305
305
|
console.log('You selected option: ', option);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
const oAutocompleteElement = document.getElementById('
|
|
308
|
+
const oAutocompleteElement = document.getElementById('my-o-autocomplete-element');
|
|
309
309
|
new oAutocomplete(oAutocompleteElement, {
|
|
310
310
|
onConfirm
|
|
311
311
|
mapOptionToSuggestedValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/o-autocomplete",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "An origami component for autocomplete inputs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"autocomplete",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@financial-times/o-utils": "^2.1.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@financial-times/accessible-autocomplete": "^
|
|
50
|
+
"@financial-times/accessible-autocomplete": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"private": false
|
|
53
53
|
}
|
package/src/js/autocomplete.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// We use our own fork of accessible-autocomplete because the main package is not being actively maintained and has bugs which we needed to fix
|
|
2
2
|
// There is a changelog for the fixes we've added -- https://github.com/Financial-Times/accessible-autocomplete/blob/master/CHANGELOG.md#210---2021-05-24
|
|
3
3
|
// Below are the pull-requests to accessible-autocomplete which would fix the bugs:
|
|
4
|
-
// https://github.com/alphagov/accessible-autocomplete/pull/497
|
|
5
4
|
// https://github.com/alphagov/accessible-autocomplete/pull/491
|
|
6
|
-
// https://github.com/alphagov/accessible-autocomplete/pull/496
|
|
7
5
|
// If the above pull-requests are merged and published, then we can stop using our fork
|
|
6
|
+
// though switching to alphagov/accessible-autocomplete will require that consumers
|
|
7
|
+
// applying `aria-labelledby` to the `ul` element
|
|
8
|
+
// via the `ariaLabelledBy` option (https://github.com/Financial-Times/accessible-autocomplete/pull/6)
|
|
9
|
+
// instead do so via the `menuAttributes` option (https://github.com/alphagov/accessible-autocomplete/pull/591)
|
|
8
10
|
import accessibleAutocomplete from '@financial-times/accessible-autocomplete';
|
|
9
11
|
|
|
10
12
|
/**
|