editable-text: Allow autocomplete with wrapping
This commit is contained in:
parent
3e6cc03e2e
commit
38764efb5a
1 changed files with 5 additions and 5 deletions
|
@ -194,17 +194,17 @@
|
|||
let autocompleteParams = this.autocomplete;
|
||||
let autocompleteEnabled = !this.multiline && !!autocompleteParams;
|
||||
if (!this._input
|
||||
|| (this._input.constructor.name === 'AutocompleteInput') !== autocompleteEnabled
|
||||
|| (this._input.hasAttribute('autocomplete')) !== autocompleteEnabled
|
||||
|| this._input.tagName !== (this.noWrap ? 'input' : 'textarea')) {
|
||||
let input;
|
||||
let inputTagName = this.noWrap ? 'input' : 'textarea';
|
||||
if (autocompleteEnabled) {
|
||||
input = document.createElement('input', { is: 'autocomplete-input' });
|
||||
input.type = 'autocomplete';
|
||||
input = document.createElement(inputTagName, { is: `autocomplete-${inputTagName}` });
|
||||
}
|
||||
else {
|
||||
input = this.noWrap ? document.createElement('input') : document.createElement('textarea');
|
||||
input.rows = 1;
|
||||
input = document.createElement(inputTagName);
|
||||
}
|
||||
input.rows = 1;
|
||||
input.classList.add('input');
|
||||
input.toggleAttribute("no-windows-native", true);
|
||||
input.addEventListener('input', this._handleInput);
|
||||
|
|
Loading…
Reference in a new issue