resolve dropdown tabIndex issue
This commit is contained in:
parent
25ff61fe47
commit
58de68a878
@ -183,7 +183,7 @@ class Dropdown {
|
|||||||
label.setAttribute('type', 'text');
|
label.setAttribute('type', 'text');
|
||||||
options.placeholder && label.setAttribute('placeholder', options.placeholder);
|
options.placeholder && label.setAttribute('placeholder', options.placeholder);
|
||||||
isPositive(options.maxlength) && label.setAttribute('maxlength', options.maxlength);
|
isPositive(options.maxlength) && label.setAttribute('maxlength', options.maxlength);
|
||||||
isPositive(options.tabindex) && label.setAttribute('tabindex', options.tabindex);
|
isPositive(options.tabIndex) && label.setAttribute('tabindex', options.tabIndex);
|
||||||
label.addEventListener('input', e => {
|
label.addEventListener('input', e => {
|
||||||
const key = e.target.value.toLowerCase();
|
const key = e.target.value.toLowerCase();
|
||||||
const source = filterSource(options.searchkeys, options.textkey, key, this.source);
|
const source = filterSource(options.searchkeys, options.textkey, key, this.source);
|
||||||
@ -193,7 +193,7 @@ class Dropdown {
|
|||||||
label.addEventListener('blur', e => this.select(e.target.value));
|
label.addEventListener('blur', e => this.select(e.target.value));
|
||||||
label.addEventListener('mousedown', e => this.#expanded && e.stopPropagation());
|
label.addEventListener('mousedown', e => this.#expanded && e.stopPropagation());
|
||||||
} else {
|
} else {
|
||||||
isPositive(options.tabindex) && header.setAttribute('tabindex', options.tabindex);
|
isPositive(options.tabIndex) && header.setAttribute('tabindex', options.tabIndex);
|
||||||
label = createElement('label', 'ui-drop-text');
|
label = createElement('label', 'ui-drop-text');
|
||||||
}
|
}
|
||||||
this.#label = label;
|
this.#label = label;
|
||||||
@ -341,7 +341,7 @@ class Dropdown {
|
|||||||
const search = createElement('div', 'ui-drop-search');
|
const search = createElement('div', 'ui-drop-search');
|
||||||
const input = createElement('input');
|
const input = createElement('input');
|
||||||
input.setAttribute('type', 'text');
|
input.setAttribute('type', 'text');
|
||||||
isPositive(options.tabindex) && input.setAttribute('tabindex', options.tabindex);
|
isPositive(options.tabIndex) && input.setAttribute('tabindex', options.tabIndex);
|
||||||
!nullOrEmpty(options.searchplaceholder) && input.setAttribute('placeholder', options.searchplaceholder);
|
!nullOrEmpty(options.searchplaceholder) && input.setAttribute('placeholder', options.searchplaceholder);
|
||||||
input.addEventListener('input', e => {
|
input.addEventListener('input', e => {
|
||||||
const key = e.target.value.toLowerCase();
|
const key = e.target.value.toLowerCase();
|
||||||
@ -520,7 +520,7 @@ class Dropdown {
|
|||||||
const drop = new Dropdown({
|
const drop = new Dropdown({
|
||||||
selected: sel.value,
|
selected: sel.value,
|
||||||
disabled: sel.disabled,
|
disabled: sel.disabled,
|
||||||
tabindex: sel.tabIndex
|
tabIndex: sel.tabIndex
|
||||||
});
|
});
|
||||||
drop.source = source;
|
drop.source = source;
|
||||||
sel.parentElement.replaceChild(drop.create(), sel);
|
sel.parentElement.replaceChild(drop.create(), sel);
|
||||||
|
631
package-lock.json
generated
631
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user