Browse Source

fix(coordinator): hide bottom action button during keyboard open to prevent glow artifact

master
mortezaei 24 hours ago
parent
commit
63d638c5df
  1. 13
      src/app/globals.css
  2. 2
      src/components/Componentes/fix-to-the-end.tsx
  3. 3
      src/components/Componentes/question-number.test.tsx
  4. 3
      src/components/Componentes/question-viewport-coordinator.ts

13
src/app/globals.css

@ -412,6 +412,19 @@ body.section-overlay-open .app-shell {
will-change: transform; will-change: transform;
} }
.question-fix-to-end {
transition:
opacity 200ms ease-out,
transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
body.question-keyboard-open .question-fix-to-end {
opacity: 0 !important;
pointer-events: none !important;
transform: translate3d(0, 120%, 0) !important;
}
.page-background-none, .page-background-none,
.page-background-custom, .page-background-custom,
.page-background-default { .page-background-default {

2
src/components/Componentes/fix-to-the-end.tsx

@ -12,7 +12,7 @@ export function FixToTheEnd({ children, className }: FixToTheEndProps) {
<div <div
style={{ paddingBottom: "calc(16px + var(--safe-bottom))" }} style={{ paddingBottom: "calc(16px + var(--safe-bottom))" }}
className={[ className={[
"fixed inset-x-0 bottom-0 z-20 mx-auto w-full sm:max-w-[375px] bg-[#F5F5F5]/95 px-[17px] pt-3 backdrop-blur-md",
"question-fix-to-end fixed inset-x-0 bottom-0 z-20 mx-auto w-full sm:max-w-[375px] bg-[#F5F5F5]/95 px-[17px] pt-3 backdrop-blur-md",
className, className,
] ]
.filter(Boolean) .filter(Boolean)

3
src/components/Componentes/question-number.test.tsx

@ -40,10 +40,11 @@ describe("QuestionNumber Component", () => {
type: "number", type: "number",
order: 1, order: 1,
required: true, required: true,
baseRequired: true,
isVisible: true, isVisible: true,
description: "", description: "",
tooltip: "", tooltip: "",
extras: { placeHolder: "e.g. 3", range: [0, 20] },
extras: { placeHolder: "e.g. 3", range: [0, 20], options: [] },
options: [], options: [],
ui_config: {}, ui_config: {},
}; };

3
src/components/Componentes/question-viewport-coordinator.ts

@ -94,7 +94,8 @@ function setLift(nextLift: number) {
const prevLift = currentLift; const prevLift = currentLift;
currentLift = Math.max(0, Math.round(nextLift)); currentLift = Math.max(0, Math.round(nextLift));
document.documentElement.style.setProperty(LIFT_VARIABLE, `${currentLift}px`); document.documentElement.style.setProperty(LIFT_VARIABLE, `${currentLift}px`);
const isOpen = currentLift > 0 && keyboardVisible && activeQuestionInput !== null;
const isOpen =
(currentLift > 0 || keyboardVisible) && activeQuestionInput !== null;
document.body.classList.toggle("question-keyboard-open", isOpen); document.body.classList.toggle("question-keyboard-open", isOpen);
console.log(`[Coord] setLift: ${prevLift}px -> ${currentLift}px | visible: ${keyboardVisible} | class: ${isOpen}`); console.log(`[Coord] setLift: ${prevLift}px -> ${currentLift}px | visible: ${keyboardVisible} | class: ${isOpen}`);
} }

Loading…
Cancel
Save