Skip to content

Commit 272320e

Browse files
committed
v10.2.1 => Release Notes for details
1 parent cf91a85 commit 272320e

17 files changed

+42
-47
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ autoComplete.js is a simple, pure vanilla Javascript library progressively desig
5151
`JS`
5252

5353
```html
54-
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/autoComplete.min.js"></script>
54+
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/autoComplete.min.js"></script>
5555
```
5656

5757
`CSS`
5858

5959
```html
60-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/css/autoComplete.min.css">
60+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/css/autoComplete.min.css">
6161
```
6262
#### Package Manager
6363

dist/autoComplete.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,7 @@
464464
if (ctx.cursor >= 0) select(ctx, event);
465465
break;
466466
case 9:
467-
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
468-
event.preventDefault();
469-
select(ctx, event);
470-
}
467+
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);
471468
break;
472469
case 27:
473470
ctx.input.value = "";

dist/autoComplete.js.gz

-12 Bytes
Binary file not shown.

dist/autoComplete.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/autoComplete.min.js.gz

-9 Bytes
Binary file not shown.

docs/demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
7373
<meta name="theme-color" content="#ffffff">
7474
<link rel="stylesheet" type="text/css" media="screen"
75-
href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/css/autoComplete.min.css">
75+
href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/css/autoComplete.min.css">
7676
<!-- <link rel="stylesheet" type="text/css" media="screen" href="./css/autoComplete.css"> -->
7777
<link rel="stylesheet" type="text/css" media="screen" href="./css/main.css">
7878
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
@@ -150,7 +150,7 @@ <h4>mode</h4>
150150
</div>
151151
</footer>
152152
</div>
153-
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/autoComplete.min.js"></script>
153+
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/autoComplete.min.js"></script>
154154
<!-- <script src="./js/autoComplete.js"></script> -->
155155
<script src="./js/index.js"></script>
156156
</body>

docs/demo/js/autoComplete.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,7 @@
464464
if (ctx.cursor >= 0) select(ctx, event);
465465
break;
466466
case 9:
467-
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
468-
event.preventDefault();
469-
select(ctx, event);
470-
}
467+
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);
471468
break;
472469
case 27:
473470
ctx.input.value = "";

docs/demo/js/autoComplete.js.gz

-12 Bytes
Binary file not shown.

docs/demo/js/autoComplete.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/demo/js/autoComplete.min.js.gz

-9 Bytes
Binary file not shown.

docs/demo/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const autoCompleteJS = new autoComplete({
3232
resultsList: {
3333
element: (list, data) => {
3434
const info = document.createElement("p");
35-
if (data.results.length > 0) {
35+
if (data.results.length) {
3636
info.innerHTML = `Displaying <strong>${data.results.length}</strong> out of <strong>${data.matches.length}</strong> results`;
3737
} else {
3838
info.innerHTML = `Found <strong>${data.matches.length}</strong> matching results for <strong>"${data.query}"</strong>`;

docs/how-to-guides.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ events: {
4444
// autoComplete.js Config Options
4545
resultsList: {
4646
element: (list, query) => {
47-
// Create "No Results" message list element
48-
const message = document.createElement("div");
49-
message.setAttribute("class", "no_result");
50-
// Add message text content
51-
message.innerHTML = `<span>Found No Results for "${query}"</span>`;
52-
// Add message list element to the list
53-
list.appendChild(message);
47+
if (!data.results.length) {
48+
// Create "No Results" message list element
49+
const message = document.createElement("div");
50+
message.setAttribute("class", "no_result");
51+
// Add message text content
52+
message.innerHTML = `<span>Found No Results for "${query}"</span>`;
53+
// Add message list element to the list
54+
list.appendChild(message);
55+
}
5456
},
5557
noResults: true,
5658
}

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
src="//platform-api.sharethis.com/js/sharethis.js#property=5c213660c276020011d38212&product=inline-share-buttons"
159159
async="async"></script>
160160
<link rel="stylesheet"
161-
href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/css/autoComplete.min.css">
161+
href="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/css/autoComplete.min.css">
162162
</head>
163163

164164
<body>
@@ -209,7 +209,7 @@
209209
mustache: {
210210
data: ["../package.json", {
211211
minVersion: "10.2",
212-
version: "10.2.0"
212+
version: "10.2.1"
213213
}]
214214
}
215215
}
@@ -224,7 +224,7 @@
224224
<script src="https://cdn.jsdelivr.net/npm/docsify-example-panels"></script>
225225
<script src="//cdn.jsdelivr.net/npm/codeblock-iframe@latest/dist/index.min.js"></script>
226226
<script src="//cdn.jsdelivr.net/npm/docsify-codeblock-iframe@latest/dist/index.min.js"></script>
227-
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.0/dist/autoComplete.min.js"></script>
227+
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/autocomplete.js@10.2.1/dist/autoComplete.min.js"></script>
228228
</body>
229229

230230
</html>

docs/release-notes.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ For more information on semantic versioning, please visit <http://semver.org/>.
3535

3636
***
3737

38-
### v10.2.0 ✨
38+
### v10.2.1 ✨
39+
- 🧹 Removed: `preventDefault` on `Tab` key press event
40+
- 🎛️ Updated: `No Results Found` example under `How-to Guides` in documentation
41+
42+
### v10.2.0
3943
- ➕ Added: `submit` API property controls `Enter` button default behavior (Thanks 👍 @CodeWithOz) #249 #224 #189
4044
- ➕ Added: `query` parameter to the `start("query")` API method for programmatic operations
4145
- 🔧 Fixed: Generated errors when `resultsList` is disabled due to the attachment of the `keydown` event

docs/sitemap.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,54 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://tarekraafat.github.io/autoComplete.js/</loc>
5-
<lastmod>2021-05-29</lastmod>
5+
<lastmod>2021-07-04</lastmod>
66
</url>
77
<url>
88
<loc>https://tarekraafat.github.io/autoComplete.js/#/getting-started</loc>
9-
<lastmod>2021-05-29</lastmod>
9+
<lastmod>2021-07-04</lastmod>
1010
</url>
1111
<url>
1212
<loc>https://tarekraafat.github.io/autoComplete.js/#/installation</loc>
13-
<lastmod>2021-05-29</lastmod>
13+
<lastmod>2021-07-04</lastmod>
1414
</url>
1515
<url>
1616
<loc>https://tarekraafat.github.io/autoComplete.js/#/usage</loc>
17-
<lastmod>2021-05-29</lastmod>
17+
<lastmod>2021-07-04</lastmod>
1818
</url>
1919
<url>
2020
<loc>https://tarekraafat.github.io/autoComplete.js/#/configuration</loc>
21-
<lastmod>2021-05-29</lastmod>
21+
<lastmod>2021-07-04</lastmod>
2222
</url>
2323
<url>
2424
<loc>https://tarekraafat.github.io/autoComplete.js/#/playground</loc>
25-
<lastmod>2021-05-29</lastmod>
25+
<lastmod>2021-07-04</lastmod>
2626
</url>
2727
<url>
2828
<loc>https://tarekraafat.github.io/autoComplete.js/#/styles</loc>
29-
<lastmod>2021-05-29</lastmod>
29+
<lastmod>2021-07-04</lastmod>
3030
</url>
3131
<url>
3232
<loc>https://tarekraafat.github.io/autoComplete.js/#/plugins</loc>
33-
<lastmod>2021-05-29</lastmod>
33+
<lastmod>2021-07-04</lastmod>
3434
</url>
3535
<url>
3636
<loc>https://tarekraafat.github.io/autoComplete.js/#/browsers-support</loc>
37-
<lastmod>2021-05-29</lastmod>
37+
<lastmod>2021-07-04</lastmod>
3838
</url>
3939
<url>
4040
<loc>https://tarekraafat.github.io/autoComplete.js/#/how-to-guides</loc>
41-
<lastmod>2021-05-29</lastmod>
41+
<lastmod>2021-07-04</lastmod>
4242
</url>
4343
<url>
4444
<loc>https://tarekraafat.github.io/autoComplete.js/#/support</loc>
45-
<lastmod>2021-05-29</lastmod>
45+
<lastmod>2021-07-04</lastmod>
4646
</url>
4747
<url>
4848
<loc>https://tarekraafat.github.io/autoComplete.js/#/release-notes</loc>
49-
<lastmod>2021-05-29</lastmod>
49+
<lastmod>2021-07-04</lastmod>
5050
</url>
5151
<url>
5252
<loc>https://tarekraafat.github.io/autoComplete.js/#/contributions</loc>
53-
<lastmod>2021-05-29</lastmod>
53+
<lastmod>2021-07-04</lastmod>
5454
</url>
5555
</urlset>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "10.2.0",
2+
"version": "10.2.1",
33
"name": "@tarekraafat/autocomplete.js",
44
"description": "Simple autocomplete pure vanilla Javascript library.",
55
"keywords": [

src/controllers/listController.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,26 +240,21 @@ const navigate = function (event, ctx) {
240240
case 40:
241241
case 38:
242242
event.preventDefault();
243-
244243
// Move cursor based on pressed key
245244
event.keyCode === 40 ? next(ctx) : previous(ctx);
246245

247246
break;
248247
// Enter
249248
case 13:
250249
if (!ctx.submit) event.preventDefault();
251-
252250
// If cursor moved
253251
if (ctx.cursor >= 0) select(ctx, event);
254252

255253
break;
256254
// Tab
257255
case 9:
258-
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) {
259-
event.preventDefault();
260-
261-
select(ctx, event);
262-
}
256+
// Select on Tab if enabled
257+
if (ctx.resultsList.tabSelect && ctx.cursor >= 0) select(ctx, event);
263258

264259
break;
265260
// Esc

0 commit comments

Comments
 (0)