Fix double tag input on back button
This commit is contained in:
parent
09e748db73
commit
62133a8cbb
|
@ -362,9 +362,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">
|
<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">
|
||||||
<script>
|
|
||||||
setupTags();
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div id="results">
|
<div id="results">
|
||||||
|
|
|
@ -203,7 +203,14 @@
|
||||||
var inputTags = document.getElementsByClassName('tags-input');
|
var inputTags = document.getElementsByClassName('tags-input');
|
||||||
var inputBox = document.querySelector("[placeholder='Add query']");
|
var inputBox = document.querySelector("[placeholder='Add query']");
|
||||||
var isFocused = (document.activeElement === inputBox);
|
var isFocused = (document.activeElement === inputBox);
|
||||||
inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
for (index = 0; index < inputTags.length; index++) {
|
||||||
|
if (index == 0) {
|
||||||
|
inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
||||||
|
} else {
|
||||||
|
inputTags[index].remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
||||||
setupTags();
|
setupTags();
|
||||||
var inputBox = document.querySelector("[placeholder='Add query']");
|
var inputBox = document.querySelector("[placeholder='Add query']");
|
||||||
if (isFocused) {
|
if (isFocused) {
|
||||||
|
|
Loading…
Reference in New Issue