diff --git a/src/app/new-match/new-match-client.tsx b/src/app/new-match/new-match-client.tsx index 89ad7cb..dd57331 100644 --- a/src/app/new-match/new-match-client.tsx +++ b/src/app/new-match/new-match-client.tsx @@ -738,7 +738,7 @@ export default function NewMatchClient() { {/* 2. Match Summary Card Section */} -
+
{(isLoading || (!matchSummary && isFetching)) ? (
diff --git a/src/components/Componentes/discount-widget.tsx b/src/components/Componentes/discount-widget.tsx index c91b116..e35e1d2 100644 --- a/src/components/Componentes/discount-widget.tsx +++ b/src/components/Componentes/discount-widget.tsx @@ -157,12 +157,6 @@ export function DiscountWidget({ dir="auto" value={code} disabled={discountStatus === "loading" || discountResult !== null} - onFocus={(e) => { - const target = e.target; - setTimeout(() => { - target.scrollIntoView({ behavior: "smooth", block: "center" }); - }, 150); - }} onChange={(e) => { setCode(e.target.value); if (discountStatus !== "initial") { diff --git a/src/components/Componentes/information-sheet.test.tsx b/src/components/Componentes/information-sheet.test.tsx index e58840a..e0f0c0d 100644 --- a/src/components/Componentes/information-sheet.test.tsx +++ b/src/components/Componentes/information-sheet.test.tsx @@ -100,5 +100,36 @@ describe("InformationSheet", () => { expect(section?.style.paddingBottom).toBe(""); }); }); + + it("should immediately reset keyboard lift when input loses focus (focusOut)", async () => { + render( + + +
+ } + />, + ); + + const input = screen.getByTestId("test-input-blur"); + const section = document.querySelector("section"); + + input.focus(); + fireEvent.focusIn(input); + + await waitFor(() => { + expect(section?.style.paddingBottom).not.toBe(""); + }); + + input.blur(); + fireEvent.focusOut(input); + + await waitFor(() => { + expect(section?.style.paddingBottom).toBe(""); + }); + }); }); diff --git a/src/components/Componentes/information-sheet.tsx b/src/components/Componentes/information-sheet.tsx index 2c4a411..c5a9af9 100644 --- a/src/components/Componentes/information-sheet.tsx +++ b/src/components/Componentes/information-sheet.tsx @@ -360,14 +360,6 @@ export function InformationSheet({ : getDefaultKeyboardHeight(); keyboardHeight = Math.max(keyboardHeight, expectedHeight); setLift(keyboardHeight); - setTimeout(() => { - if (typeof (e.target as any)?.scrollIntoView === "function") { - (e.target as any).scrollIntoView({ - behavior: "smooth", - block: "nearest", - }); - } - }, 100); } }; @@ -378,7 +370,7 @@ export function InformationSheet({ sheetRef.current?.contains(active) && isKeyboardInputTarget(active) ? (active as HTMLElement) : null; - if (!activeInput && (viewPaddingsBridge.getConfig().keyboardHeight || 0) === 0) { + if (!activeInput) { keyboardVisible = false; keyboardHeight = 0; setLift(0); @@ -445,7 +437,7 @@ export function InformationSheet({ const content = (