@neovici/cosmoz-autocomplete 5.3.0 → 5.3.2
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/cosmoz-listbox.js +7 -2
- package/lib/autocomplete.js +1 -1
- package/package.json +1 -1
package/cosmoz-listbox.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, component, useEffect, useRef } from 'haunted';
|
|
1
|
+
import { html, component, useEffect, useRef, useMemo } from 'haunted';
|
|
2
2
|
import { ref } from 'lit-html/directives/ref.js';
|
|
3
3
|
import {
|
|
4
4
|
virtualize,
|
|
@@ -114,6 +114,11 @@ const svg =
|
|
|
114
114
|
vl.element(position.index)?.scrollIntoView({ block: 'nearest' });
|
|
115
115
|
}, [position]);
|
|
116
116
|
|
|
117
|
+
const layout = useMemo(
|
|
118
|
+
() => ({ _itemSize: { height: itemHeight - 0.00001 } }),
|
|
119
|
+
[itemHeight]
|
|
120
|
+
);
|
|
121
|
+
|
|
117
122
|
return html` <style>
|
|
118
123
|
${styles({ ...position, height, itemHeight })}
|
|
119
124
|
</style>
|
|
@@ -123,7 +128,7 @@ const svg =
|
|
|
123
128
|
items,
|
|
124
129
|
renderItem,
|
|
125
130
|
scroller: true,
|
|
126
|
-
layout
|
|
131
|
+
layout,
|
|
127
132
|
})}
|
|
128
133
|
</div>`;
|
|
129
134
|
};
|
package/lib/autocomplete.js
CHANGED
|
@@ -128,7 +128,7 @@ const blank = () => nothing,
|
|
|
128
128
|
id="input"
|
|
129
129
|
part="input"
|
|
130
130
|
.label=${label}
|
|
131
|
-
.placeholder=${placeholder}
|
|
131
|
+
.placeholder=${isSingle ? undefined : placeholder}
|
|
132
132
|
?no-label-float=${noLabelFloat}
|
|
133
133
|
?always-float-label=${isSingle || alwaysFloatLabel}
|
|
134
134
|
?readonly=${isSingle}
|