실시간 챠트 오류 수정
This commit is contained in:
@@ -347,8 +347,9 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const candleOnly = candleOnlyModeRef.current;
|
||||
let required: number;
|
||||
if (candleOnlyModeRef.current) {
|
||||
if (candleOnly) {
|
||||
mgr.applyCandleOnlyLayout(true, wrapperH);
|
||||
required = wrapperH;
|
||||
} else {
|
||||
@@ -358,14 +359,16 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
||||
required = mgr.resetPaneHeights(wrapperH);
|
||||
}
|
||||
|
||||
if (paneLayoutClamp) {
|
||||
const w = wrapper.clientWidth;
|
||||
|
||||
if (candleOnly || paneLayoutClamp) {
|
||||
// 전체보기·미니차트: 래퍼 높이에 고정 resize (autoSize 피드백 루프·무한 스크롤 방지)
|
||||
try {
|
||||
const w = wrapper.clientWidth;
|
||||
if (w > 0 && wrapperH > 0) mgr.resize(w, wrapperH);
|
||||
} catch { /* ok */ }
|
||||
}
|
||||
|
||||
if (!paneLayoutClamp && required > wrapperH + 4) {
|
||||
container.style.height = `${wrapperH}px`;
|
||||
if (candleOnly) wrapper.scrollTop = 0;
|
||||
} else if (required > wrapperH + 4) {
|
||||
container.style.height = `${required}px`;
|
||||
} else {
|
||||
container.style.height = '';
|
||||
@@ -979,9 +982,22 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
||||
if (width === prevW && height === prevH) return;
|
||||
// 이전 크기가 0이었다가 유효해진 경우 (= display:none → visible 전환)
|
||||
const wasHidden = prevW <= 0 || prevH <= 0;
|
||||
prevW = width; prevH = height;
|
||||
if (width <= 0 || height <= 0) return;
|
||||
|
||||
// 캔들 전체보기: 컨테이너가 래퍼보다 커지면 즉시 클램프 (ResizeObserver ↔ autoSize 루프 차단)
|
||||
if (candleOnlyModeRef.current) {
|
||||
const wh = wrapperRef.current?.clientHeight ?? 0;
|
||||
if (wh > 0 && height > wh + 4) {
|
||||
prevW = width;
|
||||
prevH = wh;
|
||||
const m = managerRef.current;
|
||||
if (m) applyPaneLayout(m);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
prevW = width; prevH = height;
|
||||
|
||||
if (resizeDebounceRef.current) clearTimeout(resizeDebounceRef.current);
|
||||
resizeDebounceRef.current = window.setTimeout(() => {
|
||||
resizeDebounceRef.current = null;
|
||||
@@ -1426,7 +1442,7 @@ const TradingChart: React.FC<TradingChartProps> = ({
|
||||
// wrapperRef: 스크롤 영역 (overflow-y: auto → App.css .tv-chart-wrap)
|
||||
<div
|
||||
ref={wrapperRef}
|
||||
className="tv-chart-wrap"
|
||||
className={`tv-chart-wrap${candleOnlyMode ? ' tv-chart-wrap--candle-only' : ''}`}
|
||||
style={{ flex: 1, position: 'relative', minHeight: 0 }}
|
||||
onPointerMove={handleWrapperMouseMove}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user