@geckoui/geckoui 1.6.1 → 1.6.3
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/dist/index.js +9 -4
- package/dist/index.mjs +9 -4
- package/dist/styles.css +0 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4465,8 +4465,13 @@ var Select = (props) => {
|
|
|
4465
4465
|
(0, import_react31.flip)({ padding: 6 }),
|
|
4466
4466
|
(0, import_react31.offset)({ mainAxis: 6 }),
|
|
4467
4467
|
(0, import_react31.size)({
|
|
4468
|
-
|
|
4469
|
-
|
|
4468
|
+
padding: 6,
|
|
4469
|
+
apply({ rects, availableWidth, elements }) {
|
|
4470
|
+
Object.assign(elements.floating.style, {
|
|
4471
|
+
width: "max-content",
|
|
4472
|
+
minWidth: `${rects.reference.width}px`,
|
|
4473
|
+
maxWidth: `${availableWidth}px`
|
|
4474
|
+
});
|
|
4470
4475
|
}
|
|
4471
4476
|
})
|
|
4472
4477
|
],
|
|
@@ -4617,7 +4622,7 @@ var SelectOption = (_a) => {
|
|
|
4617
4622
|
const focused = !isNil_default(focusedOption) && isEqual_default(focusedOption == null ? void 0 : focusedOption.value, value);
|
|
4618
4623
|
(0, import_react33.useEffect)(() => {
|
|
4619
4624
|
if (!ref.current || !menuScrollContainerRef.current) return;
|
|
4620
|
-
if ((focusedOption == null ? void 0 : focusedOption.focusType)
|
|
4625
|
+
if ((focusedOption == null ? void 0 : focusedOption.focusType) !== "mouse" && focused) {
|
|
4621
4626
|
const scrollContainer = menuScrollContainerRef.current;
|
|
4622
4627
|
const optionRect = ref.current.getBoundingClientRect();
|
|
4623
4628
|
const containerRect = scrollContainer.getBoundingClientRect();
|
|
@@ -4629,7 +4634,7 @@ var SelectOption = (_a) => {
|
|
|
4629
4634
|
const optionHeight = ref.current.clientHeight;
|
|
4630
4635
|
scrollContainer.scrollTo({
|
|
4631
4636
|
top: optionTop - containerHeight / 2 + optionHeight / 2,
|
|
4632
|
-
behavior: "smooth"
|
|
4637
|
+
behavior: (focusedOption == null ? void 0 : focusedOption.focusType) === "initial" ? "auto" : "smooth"
|
|
4633
4638
|
});
|
|
4634
4639
|
}
|
|
4635
4640
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4377,8 +4377,13 @@ var Select = (props) => {
|
|
|
4377
4377
|
flip4({ padding: 6 }),
|
|
4378
4378
|
offset4({ mainAxis: 6 }),
|
|
4379
4379
|
size({
|
|
4380
|
-
|
|
4381
|
-
|
|
4380
|
+
padding: 6,
|
|
4381
|
+
apply({ rects, availableWidth, elements }) {
|
|
4382
|
+
Object.assign(elements.floating.style, {
|
|
4383
|
+
width: "max-content",
|
|
4384
|
+
minWidth: `${rects.reference.width}px`,
|
|
4385
|
+
maxWidth: `${availableWidth}px`
|
|
4386
|
+
});
|
|
4382
4387
|
}
|
|
4383
4388
|
})
|
|
4384
4389
|
],
|
|
@@ -4529,7 +4534,7 @@ var SelectOption = (_a) => {
|
|
|
4529
4534
|
const focused = !isNil_default(focusedOption) && isEqual_default(focusedOption == null ? void 0 : focusedOption.value, value);
|
|
4530
4535
|
useEffect8(() => {
|
|
4531
4536
|
if (!ref.current || !menuScrollContainerRef.current) return;
|
|
4532
|
-
if ((focusedOption == null ? void 0 : focusedOption.focusType)
|
|
4537
|
+
if ((focusedOption == null ? void 0 : focusedOption.focusType) !== "mouse" && focused) {
|
|
4533
4538
|
const scrollContainer = menuScrollContainerRef.current;
|
|
4534
4539
|
const optionRect = ref.current.getBoundingClientRect();
|
|
4535
4540
|
const containerRect = scrollContainer.getBoundingClientRect();
|
|
@@ -4541,7 +4546,7 @@ var SelectOption = (_a) => {
|
|
|
4541
4546
|
const optionHeight = ref.current.clientHeight;
|
|
4542
4547
|
scrollContainer.scrollTo({
|
|
4543
4548
|
top: optionTop - containerHeight / 2 + optionHeight / 2,
|
|
4544
|
-
behavior: "smooth"
|
|
4549
|
+
behavior: (focusedOption == null ? void 0 : focusedOption.focusType) === "initial" ? "auto" : "smooth"
|
|
4545
4550
|
});
|
|
4546
4551
|
}
|
|
4547
4552
|
}
|
package/dist/styles.css
CHANGED