Compare commits

..

1 Commits

Author SHA1 Message Date
review-agent-prime[bot]
0de0ca7edf Edit apps/web/app/(app)/environments/[environmentId]/surveys/components/Modal.tsx 2024-03-04 16:40:17 +00:00
2 changed files with 19 additions and 19 deletions

View File

@@ -41,20 +41,20 @@ export default function Modal({
}
let placementClass = "";
if (placement === "bottomLeft") {
placementClass = "bottom left";
} else if (placement === "bottomRight") {
placementClass = "bottom right";
} else if (placement === "topLeft") {
placementClass = "top left";
} else if (placement === "topRight") {
placementClass = "top right";
}
return {
transform: `scale(${scaleValue})`,
transformOrigin: placementClass,
switch (placement) {
case "bottomLeft":
placementClass = "bottom left";
break;
case "bottomRight":
placementClass = "bottom right";
break;
case "topLeft":
placementClass = "top left";
break;
case "topRight":
placementClass = "top right";
break;
}
};
};

View File

@@ -40,18 +40,18 @@ export default function OpenTextQuestion({
useTtc(question.id, ttc, setTtc, startTime, setStartTime);
const handleInputChange = useCallback((inputValue: string) => {
const handleInputChange = (inputValue: string) => {
onChange({ [question.id]: inputValue });
}, [onChange, question.id]);
const handleInputResize = useCallback((event: { target: any }) => {
};
const handleInputResize = (event: { target: any }) => {
let maxHeight = 160; // 8 lines
const textarea = event.target;
textarea.style.height = "auto";
const newHeight = Math.min(textarea.scrollHeight, maxHeight);
textarea.style.height = `${newHeight}px`;
textarea.style.overflow = newHeight >= maxHeight ? "auto" : "hidden";
}, []);
};
const openTextRef = useCallback(
(currentElement: HTMLInputElement | HTMLTextAreaElement | null) => {