feature: drag support in sort panel.

This commit is contained in:
2024-05-13 16:46:55 +08:00
parent f676ec76db
commit a946012a33
14 changed files with 777 additions and 566 deletions

View File

@ -204,7 +204,8 @@ export class Dropdown {
let label;
if (options.input) {
label = createElement('input', 'ui-drop-text');
label.setAttribute('type', 'text');
label.type = 'text';
label.draggable = false;
options.placeholder && label.setAttribute('placeholder', options.placeholder);
isPositive(options.maxLength) && label.setAttribute('maxlength', options.maxLength);
isPositive(options.tabIndex) && label.setAttribute('tabindex', options.tabIndex);
@ -383,7 +384,7 @@ export class Dropdown {
if (!options.input && options.search) {
const search = createElement('div', 'ui-drop-search');
const input = createElement('input');
input.setAttribute('type', 'text');
input.type = 'text';
isPositive(options.tabIndex) && input.setAttribute('tabindex', options.tabIndex);
!nullOrEmpty(options.searchPlaceholder) && input.setAttribute('placeholder', options.searchPlaceholder);
input.addEventListener('input', e => {
@ -503,7 +504,7 @@ export class Dropdown {
}
const li = createElement('li');
li.dataset.value = val;
li.setAttribute('title', item[textkey]);
li.title = item[textkey];
let label;
const html = item[htmlkey];
if (html instanceof HTMLElement) {