diff --git a/lib/ui/css/grid.scss b/lib/ui/css/grid.scss index 093bd84..0873d04 100644 --- a/lib/ui/css/grid.scss +++ b/lib/ui/css/grid.scss @@ -412,6 +412,22 @@ } } + .ui-drop-span { + margin: 0; + + >span { + margin: var(--spacing-cell); + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: pre; + + &.wrap { + @include wrap(); + } + } + } + .ui-drop-wrapper { height: var(--row-height); width: 100%; diff --git a/lib/ui/grid/column.js b/lib/ui/grid/column.js index a16c361..cc316cd 100644 --- a/lib/ui/grid/column.js +++ b/lib/ui/grid/column.js @@ -322,6 +322,14 @@ const SymbolDropdown = Symbol.for('ui-dropdown'); export class GridDropdownColumn extends GridColumn { static get canEdit() { return true }; + /** + * @ignore + * @returns {HTMLElement} + */ + static create() { + return createElement('span', 'ui-drop-span', createElement('span')); + } + /** * @ignore * @param {Function} trigger @@ -360,7 +368,7 @@ export class GridDropdownColumn extends GridColumn { if (element.tagName === 'DIV') { return element.children[0].children[0]; } - return element; + return element.children[0]; } /** @@ -424,7 +432,7 @@ export class GridDropdownColumn extends GridColumn { if (data != null) { val = data[opts?.textKey ?? 'text']; } - super.setValue(element, val); + element.children[0].innerText = val; } /**