@aquera/nile-elements 1.2.6-beta-1.1 → 1.2.6-beta-1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/demo/index.html +46 -15
- package/dist/index.js +4 -2
- package/dist/nile-select/virtual-scroll-helper.cjs.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +2 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +1 -0
- package/dist/src/nile-select/virtual-scroll-helper.js +2 -1
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.js +1 -6
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-select/virtual-scroll-helper.ts +2 -1
- package/src/nile-virtual-select/nile-virtual-select.ts +2 -8
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "nile-elements",
|
|
6
|
-
"version": "1.2.6-beta-1.
|
|
6
|
+
"version": "1.2.6-beta-1.4",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"module": "dist/src/index.js",
|
|
@@ -1112,6 +1112,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
|
1112
1112
|
sync=${ifDefined(!this.noWidthSync ? 'width' : undefined)}
|
|
1113
1113
|
auto-size="vertical"
|
|
1114
1114
|
auto-size-padding="10"
|
|
1115
|
+
exportparts="tag__content"
|
|
1115
1116
|
>
|
|
1116
1117
|
${this.renderCustomSelect(hasCustomSelect)}
|
|
1117
1118
|
${this.renderCombobox(hasCustomSelect, hasClearIcon)}
|
|
@@ -1510,7 +1511,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
|
1510
1511
|
requestAnimationFrame(() => {
|
|
1511
1512
|
let listbox: HTMLElement | null = null;
|
|
1512
1513
|
|
|
1513
|
-
|
|
1514
|
+
|
|
1514
1515
|
if (this.portal && this.portalManager.portalContainerElement) {
|
|
1515
1516
|
listbox = this.portalManager.portalContainerElement.querySelector('#listbox') as HTMLElement;
|
|
1516
1517
|
} else {
|
|
@@ -1519,22 +1520,17 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
|
1519
1520
|
|
|
1520
1521
|
if (!listbox || !listbox.isConnected) return;
|
|
1521
1522
|
|
|
1522
|
-
// Always reset scroll position
|
|
1523
1523
|
listbox.scrollTop = 0;
|
|
1524
|
-
|
|
1525
|
-
// When very few items, collapse overflow completely
|
|
1526
1524
|
const virtualized = listbox.querySelector('.virtualized') as HTMLElement;
|
|
1527
1525
|
if (virtualized && virtualized.isConnected) {
|
|
1528
1526
|
const fewItems = this.data.length <= 5;
|
|
1529
1527
|
|
|
1530
1528
|
if (fewItems) {
|
|
1531
|
-
// 👇 Prevent *any* scrolling and let height shrink
|
|
1532
1529
|
virtualized.style.overflowY = 'hidden';
|
|
1533
1530
|
virtualized.style.maxHeight = 'none';
|
|
1534
1531
|
listbox.style.overflowY = 'hidden';
|
|
1535
1532
|
listbox.style.maxHeight = 'fit-content';
|
|
1536
1533
|
} else {
|
|
1537
|
-
// 👇 Re-enable scrolling when many items
|
|
1538
1534
|
virtualized.style.overflowY = 'auto';
|
|
1539
1535
|
virtualized.style.maxHeight = '';
|
|
1540
1536
|
listbox.style.overflowY = 'auto';
|
|
@@ -1543,8 +1539,6 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
|
|
|
1543
1539
|
|
|
1544
1540
|
virtualized.scrollTop = 0;
|
|
1545
1541
|
}
|
|
1546
|
-
|
|
1547
|
-
// lit-virtualizer (if used)
|
|
1548
1542
|
const virtualizer = listbox.querySelector('lit-virtualizer') as HTMLElement;
|
|
1549
1543
|
if (virtualizer && virtualizer.isConnected) {
|
|
1550
1544
|
virtualizer.scrollTop = 0;
|