refactor(components): 重构 playground组件
- 移除 Data、Scene 和 IodRelevant 组件中的 Drawer - 优化 Data、Scene 和 IodRelevant 组件的结构 - 添加 Header 组件用于展示标题和关闭按钮 - 使用 Main 组件替代原来的 ShowCard 组件 - 调整样式和布局,提高组件的可复用性和可维护性
This commit is contained in:
@@ -21,13 +21,15 @@ const useDynamicTextareaSize = (
|
||||
const contentHeight = currentTextarea.scrollHeight;
|
||||
|
||||
if (maxHeight) {
|
||||
|
||||
|
||||
// Set max-height and adjust overflow behavior if maxHeight is provided
|
||||
currentTextarea.style.maxHeight = `${maxHeight}px`;
|
||||
currentTextarea.style.overflowY = contentHeight > maxHeight ? "scroll" : "hidden";
|
||||
currentTextarea.style.height = `${Math.min(contentHeight, maxHeight)}px`;
|
||||
currentTextarea.style.height = `${Math.min(contentHeight, maxHeight) < 60 ? 60 : Math.min(contentHeight, maxHeight)}px`;
|
||||
currentTextarea.style.fontWeight = "normal";
|
||||
currentTextarea.style.color = "#374151";
|
||||
} else {
|
||||
|
||||
|
||||
// Adjust height without max height constraint
|
||||
currentTextarea.style.height = `${contentHeight}px`;
|
||||
}
|
||||
@@ -35,4 +37,4 @@ const useDynamicTextareaSize = (
|
||||
}, [textareaRef, textContent, maxHeight]);
|
||||
};
|
||||
|
||||
export default useDynamicTextareaSize;
|
||||
export default useDynamicTextareaSize;
|
||||
|
||||
Reference in New Issue
Block a user