Skip to content

Commit

Permalink
v10.2.1 => Release Notes for details
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekRaafat committed Jul 4, 2021
1 parent cf91a85 commit 272320e
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ autoComplete.js is a simple, pure vanilla Javascript library progressively desig
`JS`

```html
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/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
5 changes: 1 addition & 4 deletions dist/autoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,7 @@
if (ctx.cursor >= 0) select(ctx, event);
break;
case 9:
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
event.preventDefault();
select(ctx, event);
}
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);
break;
case 27:
ctx.input.value = "";
Expand Down
Binary file modified dist/autoComplete.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/autoComplete.min.js

Large diffs are not rendered by default.

Binary file modified dist/autoComplete.min.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" type="text/css" media="screen"
href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/css/autoComplete.min.css">
href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/css/autoComplete.min.css">
<!-- <link rel="stylesheet" type="text/css" media="screen" href="./css/autoComplete.css"> -->
<link rel="stylesheet" type="text/css" media="screen" href="./css/main.css">
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
Expand Down Expand Up @@ -150,7 +150,7 @@ <h4>mode</h4>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/autoComplete.min.js"></script>
<!-- <script src="./js/autoComplete.js"></script> -->
<script src="./js/index.js"></script>
</body>
Expand Down
5 changes: 1 addition & 4 deletions docs/demo/js/autoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,7 @@
if (ctx.cursor >= 0) select(ctx, event);
break;
case 9:
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
event.preventDefault();
select(ctx, event);
}
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);
break;
case 27:
ctx.input.value = "";
Expand Down
Binary file modified docs/demo/js/autoComplete.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/demo/js/autoComplete.min.js

Large diffs are not rendered by default.

Binary file modified docs/demo/js/autoComplete.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/demo/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const autoCompleteJS = new autoComplete({
resultsList: {
element: (list, data) => {
const info = document.createElement("p");
if (data.results.length > 0) {
if (data.results.length) {
info.innerHTML = `Displaying <strong>${data.results.length}</strong> out of <strong>${data.matches.length}</strong> results`;
} else {
info.innerHTML = `Found <strong>${data.matches.length}</strong> matching results for <strong>"${data.query}"</strong>`;
Expand Down
16 changes: 9 additions & 7 deletions docs/how-to-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ events: {
// autoComplete.js Config Options
resultsList: {
element: (list, query) => {
// Create "No Results" message list element
const message = document.createElement("div");
message.setAttribute("class", "no_result");
// Add message text content
message.innerHTML = `<span>Found No Results for "${query}"</span>`;
// Add message list element to the list
list.appendChild(message);
if (!data.results.length) {
// Create "No Results" message list element
const message = document.createElement("div");
message.setAttribute("class", "no_result");
// Add message text content
message.innerHTML = `<span>Found No Results for "${query}"</span>`;
// Add message list element to the list
list.appendChild(message);
}
},
noResults: true,
}
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
src="//platform-api.sharethis.com/js/sharethis.js#property=5c213660c276020011d38212&product=inline-share-buttons"
async="async"></script>
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].0/dist/css/autoComplete.min.css">
href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/css/autoComplete.min.css">
</head>

<body>
Expand Down Expand Up @@ -209,7 +209,7 @@
mustache: {
data: ["../package.json", {
minVersion: "10.2",
version: "10.2.0"
version: "10.2.1"
}]
}
}
Expand All @@ -224,7 +224,7 @@
<script src="https://cdn.jsdelivr.net/npm/docsify-example-panels"></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/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].1/dist/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 @@ -35,7 +35,11 @@ For more information on semantic versioning, please visit <http://semver.org/>.

***

### v10.2.0 ✨
### v10.2.1 ✨
- 🧹 Removed: `preventDefault` on `Tab` key press event
- 🎛️ Updated: `No Results Found` example under `How-to Guides` in documentation

### v10.2.0
- ➕ Added: `submit` API property controls `Enter` button default behavior (Thanks 👍 @CodeWithOz) #249 #224 #189
- ➕ Added: `query` parameter to the `start("query")` API method for programmatic operations
- 🔧 Fixed: Generated errors when `resultsList` is disabled due to the attachment of the `keydown` event
Expand Down
26 changes: 13 additions & 13 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/getting-started</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/installation</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/usage</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/configuration</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/playground</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/styles</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/plugins</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/browsers-support</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/how-to-guides</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/support</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/release-notes</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
<url>
<loc>https://tarekraafat.github.io/autoComplete.js/#/contributions</loc>
<lastmod>2021-05-29</lastmod>
<lastmod>2021-07-04</lastmod>
</url>
</urlset>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "10.2.0",
"version": "10.2.1",
"name": "@tarekraafat/autocomplete.js",
"description": "Simple autocomplete pure vanilla Javascript library.",
"keywords": [
Expand Down
9 changes: 2 additions & 7 deletions src/controllers/listController.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,26 +240,21 @@ const navigate = function (event, ctx) {
case 40:
case 38:
event.preventDefault();

// Move cursor based on pressed key
event.keyCode === 40 ? next(ctx) : previous(ctx);

break;
// Enter
case 13:
if (!ctx.submit) event.preventDefault();

// If cursor moved
if (ctx.cursor >= 0) select(ctx, event);

break;
// Tab
case 9:
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
event.preventDefault();

select(ctx, event);
}
// Select on Tab if enabled
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);

break;
// Esc
Expand Down

0 comments on commit 272320e

Please sign in to comment.