@goplusvn/core 0.1.95 → 0.1.96
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.1.96 — Sửa lỗi Focus Trap khiến ô tìm kiếm Combobox/MultiSelect mất focus khi lồng trong Sheet/Dialog
|
|
2
|
+
|
|
3
|
+
Khi `Combobox` hoặc `MultiSelect` nằm trong `<Sheet>` (bộ lọc mobile) hoặc `<Dialog>`,
|
|
4
|
+
Radix Dialog's `FocusScope` bắt sự kiện tương tác trên Portal và giật focus ngược lại về trigger,
|
|
5
|
+
khiến ô input tìm kiếm bị blur ngay lập tức và không thể gõ được trên một số thiết bị/trình duyệt.
|
|
6
|
+
|
|
7
|
+
**Đổi**
|
|
8
|
+
|
|
9
|
+
- `ui/primitives/combobox.tsx` & `ui/forms/multi-select.tsx` — thêm `onFocusOutside={(e) => e.preventDefault()}`
|
|
10
|
+
trên `PopoverContent`, ngăn Dialog/Sheet cha cướp focus khỏi ô tìm kiếm; kích hoạt focus trực tiếp vào
|
|
11
|
+
`searchInputRef` khi mở panel.
|
|
12
|
+
|
|
1
13
|
## 0.1.95 — Triệt tiêu Hydration Mismatch trên AvatarFallback của UserDropdown
|
|
2
14
|
|
|
3
15
|
Trong quá trình Server-Side Rendering (SSR), `useSafeAuthSession()` chưa có phiên đăng nhập
|
package/package.json
CHANGED
|
@@ -724,16 +724,11 @@ export const MultiSelect = React.forwardRef<MultiSelectRef, MultiSelectProps>(
|
|
|
724
724
|
collisionPadding={8}
|
|
725
725
|
onOpenAutoFocus={(e) => {
|
|
726
726
|
e.preventDefault();
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
(typeof window.innerWidth === "number" &&
|
|
733
|
-
window.innerWidth < 640));
|
|
734
|
-
if (!isTouchOrMobile) {
|
|
735
|
-
searchInputRef.current?.focus();
|
|
736
|
-
}
|
|
727
|
+
searchInputRef.current?.focus();
|
|
728
|
+
}}
|
|
729
|
+
onFocusOutside={(e) => {
|
|
730
|
+
// Ngăn Dialog / Sheet cha giật focus khỏi ô tìm kiếm của Popover portal
|
|
731
|
+
e.preventDefault();
|
|
737
732
|
}}
|
|
738
733
|
className="z-[100] flex w-[var(--radix-popover-trigger-width)] min-w-[15rem] max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md border bg-popover/95 p-0 text-popover-foreground shadow-lg shadow-black/5 backdrop-blur-md"
|
|
739
734
|
style={{
|
|
@@ -178,15 +178,11 @@ export function Combobox({
|
|
|
178
178
|
collisionPadding={8}
|
|
179
179
|
onOpenAutoFocus={(e) => {
|
|
180
180
|
e.preventDefault();
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
(typeof window.innerWidth === "number" && window.innerWidth < 640));
|
|
187
|
-
if (!isTouchOrMobile) {
|
|
188
|
-
searchInputRef.current?.focus();
|
|
189
|
-
}
|
|
181
|
+
searchInputRef.current?.focus();
|
|
182
|
+
}}
|
|
183
|
+
onFocusOutside={(e) => {
|
|
184
|
+
// Ngăn Dialog / Sheet cha giật focus khỏi ô tìm kiếm của Popover portal
|
|
185
|
+
e.preventDefault();
|
|
190
186
|
}}
|
|
191
187
|
className="z-[100] w-[var(--radix-popover-trigger-width)] min-w-[12rem] max-w-[calc(100vw-1rem)] p-0 flex flex-col overflow-hidden"
|
|
192
188
|
style={{
|