mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-28 09:20:49 -06:00
Compare commits
1 Commits
ReviewBot/
...
ReviewBot/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b34763090 |
@@ -41,20 +41,20 @@ export default function Modal({
|
||||
}
|
||||
|
||||
let 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;
|
||||
}
|
||||
|
||||
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,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -40,18 +40,18 @@ export default function OpenTextQuestion({
|
||||
|
||||
useTtc(question.id, ttc, setTtc, startTime, setStartTime);
|
||||
|
||||
const handleInputChange = (inputValue: string) => {
|
||||
const handleInputChange = useCallback((inputValue: string) => {
|
||||
onChange({ [question.id]: inputValue });
|
||||
};
|
||||
|
||||
const handleInputResize = (event: { target: any }) => {
|
||||
}, [onChange, question.id]);
|
||||
|
||||
const handleInputResize = useCallback((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) => {
|
||||
|
||||
Reference in New Issue
Block a user