chores: Lint + dependency update

This commit is contained in:
Liyas Thomas
2020-09-27 23:34:15 +05:30
parent ee066d7859
commit 7e1e61f8af
12 changed files with 63 additions and 68 deletions

View File

@@ -89,7 +89,7 @@ describe("autocomplete", () => {
await selectedSuggestion.trigger("click")
await wrapper.vm.$nextTick()
expect(input.element.value).toEqual("b" + selectedText)
expect(input.element.value).toEqual(`b${selectedText}`)
})
test("hide selection on pressing ESC", async () => {
@@ -255,7 +255,7 @@ describe("autocomplete", () => {
})
await wrapper.vm.$nextTick()
expect(input.element.value).toEqual("a" + selectedSuggestion)
expect(input.element.value).toEqual(`a${selectedSuggestion}`)
})
test("pressing tab when nothing is selected selects the first suggestion", async () => {
@@ -272,7 +272,7 @@ describe("autocomplete", () => {
})
await wrapper.vm.$nextTick()
expect(input.element.value).toEqual("a" + firstSuggestionText)
expect(input.element.value).toEqual(`a${firstSuggestionText}`)
})
test("pressing any non-special key doesn't do anything", async () => {
@@ -294,6 +294,6 @@ describe("autocomplete", () => {
})
await wrapper.vm.$nextTick()
expect(input.element.value).toEqual("a" + selectedSuggestion)
expect(input.element.value).toEqual(`a${selectedSuggestion}`)
})
})

View File

@@ -1,20 +1,24 @@
<template>
<div contenteditable class="url-field" ref="editor" spellcheck="false"></div>
</template>
<style lang="scss">
.highlight-VAR {
@apply font-bold;
color: var(--ac-color);
@apply text-acColor;
}
.highlight-TEXT {
@apply overflow-auto;
@apply break-all;
height: 20px;
height: 22px;
}
.highlight-TEXT::-webkit-scrollbar {
@apply hidden;
}
</style>
<script>
export default {
props: {
@@ -81,9 +85,9 @@ export default {
return map
},
getTextSegments(element) {
getTextSegments({ childNodes }) {
const textSegments = []
Array.from(element.childNodes).forEach((node) => {
Array.from(childNodes).forEach((node) => {
switch (node.nodeType) {
case Node.TEXT_NODE:
textSegments.push({ text: node.nodeValue, node })