Implement first unit-tests #6
@@ -56,6 +56,12 @@ export default defineComponent({
 | 
				
			|||||||
            if(e.key == "Enter") {
 | 
					            if(e.key == "Enter") {
 | 
				
			||||||
                const selected = this.$data.Suggestions[0];
 | 
					                const selected = this.$data.Suggestions[0];
 | 
				
			||||||
                this.selectElement(selected);
 | 
					                this.selectElement(selected);
 | 
				
			||||||
 | 
					                const el = (<HTMLInputElement>e.target);
 | 
				
			||||||
 | 
					                const inputElements = Array.from(el.ownerDocument.querySelectorAll('input:not([disabled]):not([readonly])'));
 | 
				
			||||||
 | 
					                const currentIndex = inputElements.indexOf(el);
 | 
				
			||||||
 | 
					                const nextElement = inputElements[currentIndex < inputElements.length - 1 ? currentIndex + 1 : 0];
 | 
				
			||||||
 | 
					                (<HTMLInputElement>nextElement).focus();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        selectElement(element : Suggestion) {
 | 
					        selectElement(element : Suggestion) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user