Skip to content

Commit

Permalink
v9.0.1 => Release Notes for details
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekRaafat committed Apr 16, 2021
1 parent a99167e commit 8c195d4
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ autoComplete.js is a simple pure vanilla Javascript library that's progressively
`JS`

```html
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/js/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/js/autoComplete.min.js"></script>
```

`CSS`

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/css/autoComplete.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/css/autoComplete.min.css">
```
#### Package Manager

Expand Down
10 changes: 4 additions & 6 deletions dist/js/autoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
list.setAttribute("id", config.resultsList.idName);
list.setAttribute("class", config.resultsList.className);
list.setAttribute("role", "listbox");
list.setAttribute("tabindex", "-1");
if (config.resultsList.container) config.resultsList.container(list);
var destination = "string" === typeof config.resultsList.destination ? document.querySelector(config.resultsList.destination) : config.resultsList.destination();
destination.insertAdjacentElement(config.resultsList.position, list);
Expand All @@ -187,9 +186,9 @@
}));
});

var closeList = function closeList(config, element) {
var closeList = function closeList(config) {
var list = document.getElementById(config.resultsList.idName);
if (list && element !== config.inputField) {
if (list) {
list.remove();
config.inputField.removeAttribute("aria-activedescendant");
config.inputField.setAttribute("aria-expanded", false);
Expand Down Expand Up @@ -278,7 +277,6 @@
config.inputField.value = "";
closeList(config);
break;
case 9:
case 40:
update(event, list, true);
break;
Expand Down Expand Up @@ -532,8 +530,8 @@
generateList(this, dataFeedback, results);
navigate(this, dataFeedback);
eventEmitter(this.inputField, dataFeedback, "open");
document.addEventListener("click", function (event) {
return closeList(_this, event.target);
document.addEventListener("focusout", function () {
return closeList(_this);
});
}
}, {
Expand Down
Binary file modified dist/js/autoComplete.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/js/autoComplete.min.js

Large diffs are not rendered by default.

Binary file modified dist/js/autoComplete.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h4>mode</h4>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/js/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/js/autoComplete.min.js"></script>
<script src="./js/index.js"></script>
</body>

Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
mustache: {
data: ["../package.json", {
minVersion: "9.0",
version: "9.0.0"
version: "9.0.1"
}]
}
}
Expand All @@ -206,7 +206,7 @@
<script src="//unpkg.com/docsify-copy-code"></script>
<script src="//cdn.jsdelivr.net/npm/codeblock-iframe@latest/dist/index.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-codeblock-iframe@latest/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/js/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/js/autoComplete.min.js"></script>
</body>

</html>
6 changes: 5 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ For more information on semantic versioning, please visit <http://semver.org/>.

***

### v9.0.0 ✨
### v9.0.1 ✨
- 🔧 Fixed: `resultItem.idName` issue
- 🔝 Updated: [`Tab`](https://adamsilver.io/blog/building-an-accessible-autocomplete-control/#composite-controls-should-have-a-single-tab-stop) button behavior (Thanks 👍 @ronmichael @codyjames) #175 #202

### v9.0.0
> <div class="ps-icon ps-icon-important"></div> This version has breaking changes, kindly check the list
- 🔧 Fixed: `esc` button not working with `noResults` in some cases (Thanks 👍 @sunshineplan) #157
- ➕ Added: `selection` & `highlight` custom `className` API methods (Thanks 👍 @jerrykan) #184
Expand Down
22 changes: 11 additions & 11 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/getting-started</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/installation</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/usage</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/configuration</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/playground</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/plugins</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/browsers-support</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/support</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/release-notes</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/contributions</loc>
<lastmod>2021-04-12</lastmod>
<lastmod>2021-04-16</lastmod>
</url>
</urlset>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarekraafat/autocomplete.js",
"version": "9.0.0",
"version": "9.0.1",
"description": "Simple autocomplete pure vanilla Javascript library.",
"keywords": [
"simple",
Expand Down
2 changes: 1 addition & 1 deletion src/autoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class autoComplete {
* and closes list if clicked outside the list and inputField
* @listens {click} Listens to all `click` events on the document
**/
document.addEventListener("click", (event) => closeList(this, event.target));
document.addEventListener("focusout", () => closeList(this));
}

async dataStore() {
Expand Down
1 change: 0 additions & 1 deletion src/components/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default (config) => {
list.setAttribute("id", config.resultsList.idName);
list.setAttribute("class", config.resultsList.className);
list.setAttribute("role", "listbox");
list.setAttribute("tabindex", "-1");
// If custom container set pass the list
if (config.resultsList.container) config.resultsList.container(list);
// List rendering destination
Expand Down
7 changes: 3 additions & 4 deletions src/controllers/listController.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import createItem from "../components/Item";
import eventEmitter from "../utils/eventEmitter";

/**
* Close all open lists
* Close open list
*
* @param {Object} config - autoComplete configurations
* @param {Element} element - Current selected element
*
*/
const closeList = (config, element) => {
const closeList = (config) => {
// Get autoComplete list
const list = document.getElementById(config.resultsList.idName);
if (list && element !== config.inputField) {
if (list) {
// Remove open list
list.remove();
// Remove active descendant
Expand Down
5 changes: 3 additions & 2 deletions src/controllers/navigationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,18 @@ const navigate = (config, dataFeedback) => {
switch (event.keyCode) {
case 27:
// If the ESC key is pressed
// Clear Input value
// Clears Input field
config.inputField.value = "";
// Closes open list
closeList(config);
break;
case 9:
case 40:
// If the DOWN key is pressed
// Update list items state
update(event, list, true);
break;
case 38:
// If the UP key is pressed
// Update list items state
update(event, list, false);
break;
Expand Down

0 comments on commit 8c195d4

Please sign in to comment.