Allow autofocus to be set on an autocomplete input

This commit is contained in:
JC Brand 2022-06-01 22:03:24 +02:00
parent 1ad6de2dd6
commit 4c8bc187b2

View File

@ -7,6 +7,7 @@ import { html } from 'lit';
export default class AutoCompleteComponent extends CustomElement { export default class AutoCompleteComponent extends CustomElement {
static get properties () { static get properties () {
return { return {
'autofocus': { type: Boolean },
'getAutoCompleteList': { type: Function }, 'getAutoCompleteList': { type: Function },
'auto_evaluate': { type: Boolean }, 'auto_evaluate': { type: Boolean },
'auto_first': { type: Boolean }, // Should the first element be automatically selected? 'auto_first': { type: Boolean }, // Should the first element be automatically selected?
@ -36,6 +37,7 @@ export default class AutoCompleteComponent extends CustomElement {
<div class="suggestion-box suggestion-box__name"> <div class="suggestion-box suggestion-box__name">
<ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul> <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>
<input <input
?autofocus=${this.autofocus}
type="text" type="text"
name="${this.name}" name="${this.name}"
autocomplete="off" autocomplete="off"