Skip to content

Commit

Permalink
Version 7.0.3 => Release History for details
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekRaafat committed Sep 26, 2019
1 parent 8c32656 commit 8d0fdc6
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ git clone https://github.com/TarekRaafat/autoComplete.js.git
`CSS`

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

`JS`

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

- <a href="https://www.npmjs.com/package/@tarekraafat/autocomplete.js">npm</a> install `(Node Package Manager)`
Expand Down
9 changes: 4 additions & 5 deletions dist/js/autoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
return Constructor;
}

var dataAttribute = "data-result";
var dataAttribute = "data-id";
var select = {
resultsList: "autoComplete_results_list",
result: "autoComplete_result",
Expand All @@ -50,8 +50,8 @@
var addResultsToList = function addResultsToList(resultsList, dataSrc, resultItem) {
dataSrc.forEach(function (event, record) {
var result = document.createElement(resultItem.element);
var resultValue = dataSrc[record].value[event.key] || dataSrc[record].value;
result.setAttribute(dataAttribute, resultValue);
var resultIndex = dataSrc[record].index;
result.setAttribute(dataAttribute, resultIndex);
result.setAttribute("class", select.result);
result.setAttribute("tabindex", "1");
resultItem.content ? resultItem.content(event, result) : result.innerHTML = event.match || event;
Expand Down Expand Up @@ -98,8 +98,7 @@
return record.value;
}),
selection: resultsValues.list.find(function (value) {
var resValue = value.value[value.key] || value.value;
return resValue === event.target.closest(".".concat(select.result)).getAttribute(dataAttribute);
return value.index === Number(event.target.closest(".".concat(select.result)).getAttribute(dataAttribute));
})
});
clearResults(resultsList);
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/js/autoComplete.min.js.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ npm run build
`CSS`

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

`JS`

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

- <img src="./img/logos/html_logo.png" alt="HTML Logo" width="40px"> HTML Local load
Expand Down Expand Up @@ -121,7 +121,7 @@ const autoComplete = require("@tarekraafat/autocomplete.js/dist/js/autoComplete"
```html
<link rel="stylesheet" href="./css/autoComplete.css">
OR
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].2/dist/css/autoComplete.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].3/dist/css/autoComplete.min.css">
```

2. Assign the default `id` value `"autoComplete"` to the desired input field or use any custom `id/class` and configure the API selector accordingly in `Step 4`
Expand All @@ -136,7 +136,7 @@ OR
<script src="./js/autoComplete.min.js"></script>
<script src="./js/index.js"></script>
OR
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].2/dist/js/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].3/dist/js/autoComplete.min.js"></script>
<script src="./js/index.js"></script>
```

Expand Down
4 changes: 2 additions & 2 deletions docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<meta name="msapplication-TileColor" content="#ffffff">
<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].2/dist/css/autoComplete.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].3/dist/css/autoComplete.min.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">
</head>
Expand Down Expand Up @@ -119,7 +119,7 @@ <h4>mode</h4>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].2/dist/js/autoComplete.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tarekraafat/[email protected].3/dist/js/autoComplete.min.js"></script>
<script src="./js/index.js"></script>
</body>

Expand Down
5 changes: 4 additions & 1 deletion docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ Release flags:

## Release Notes

- v7.0.2 :sparkles:
- v7.0.3 :sparkles:
- Duplicate values selection bug fix (Thanks 👍 @plungerman)

- v7.0.2
- Data Promise bug fix (Thanks 👍 @braco)
- Remote API duplicate calls fix (Thanks 👍 @srinivas025, @argebynogame)
- `trigger.condition` enhancement (Thanks 👍 @sakuraineed)
Expand Down
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": "7.0.2",
"version": "7.0.3",
"description": "Simple autocomplete pure vanilla Javascript library.",
"main": "dist/js/autoComplete.js",
"browser": "dist/js/autoComplete.min.js",
Expand Down
Loading

0 comments on commit 8d0fdc6

Please sign in to comment.