Compare commits

..

1 Commits

Author SHA1 Message Date
review-agent-prime[bot]
812130cc51 Edit packages/database/migrations/20240229062232_adds_styling_column_to_product_model/migration.sql 2024-03-04 16:40:24 +00:00
2 changed files with 7 additions and 6 deletions

View File

@@ -1,2 +1,3 @@
-- AlterTable
ALTER TABLE "Product" ADD COLUMN "styling" JSONB DEFAULT '{"unifiedStyling":true,"allowStyleOverwrite":true,"brandColor":{"light":"#64748b"}}';
ALTER TABLE "Product" ADD COLUMN "styling" JSONB DEFAULT '{"unifiedStyling":true,"allowStyleOverwrite":true,"brandColor":{"light":"#64748b"}}';
CREATE INDEX idx_product_styling ON "Product" USING gin ("styling");

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) => {