diff --git a/components/splitter/Splitter.tsx b/components/splitter/Splitter.tsx index 42fcb83f46..c2bc04755b 100644 --- a/components/splitter/Splitter.tsx +++ b/components/splitter/Splitter.tsx @@ -146,65 +146,62 @@ const Splitter: React.FC> = (props) => { const mergedStyle: React.CSSProperties = { ...splitter?.style, ...style }; return wrapCSSVar( - <> - -
- {items.map((item, idx) => { - // Panel - const panel = ; + +
+ {items.map((item, idx) => { + // Panel + const panel = ; - // Split Bar - let splitBar: React.ReactElement | null = null; + // Split Bar + let splitBar: React.ReactElement | null = null; - const resizableInfo = resizableInfos[idx]; - if (resizableInfo) { - const ariaMinStart = (stackSizes[idx - 1] || 0) + itemPtgMinSizes[idx]; - const ariaMinEnd = (stackSizes[idx + 1] || 100) - itemPtgMaxSizes[idx + 1]; + const resizableInfo = resizableInfos[idx]; + if (resizableInfo) { + const ariaMinStart = (stackSizes[idx - 1] || 0) + itemPtgMinSizes[idx]; + const ariaMinEnd = (stackSizes[idx + 1] || 100) - itemPtgMaxSizes[idx + 1]; - const ariaMaxStart = (stackSizes[idx - 1] || 0) + itemPtgMaxSizes[idx]; - const ariaMaxEnd = (stackSizes[idx + 1] || 100) - itemPtgMinSizes[idx + 1]; + const ariaMaxStart = (stackSizes[idx - 1] || 0) + itemPtgMaxSizes[idx]; + const ariaMaxEnd = (stackSizes[idx + 1] || 100) - itemPtgMinSizes[idx + 1]; - splitBar = ( - { - let offset = isVertical ? offsetY : offsetX; - if (reverse) { - offset = -offset; - } - onInternalResizeUpdate(index, offset); - }} - onOffsetEnd={onInternalResizeEnd} - onCollapse={onInternalCollapse} - /> - ); - } - - return ( - - {panel} - {splitBar} - + splitBar = ( + { + let offset = isVertical ? offsetY : offsetX; + if (reverse) { + offset = -offset; + } + onInternalResizeUpdate(index, offset); + }} + onOffsetEnd={onInternalResizeEnd} + onCollapse={onInternalCollapse} + /> ); - })} -
-
+ } - {/* Fake mask for cursor */} - {typeof movingIndex === 'number' && ( -
- )} - , + return ( + + {panel} + {splitBar} + + ); + })} + {/* Fake mask for cursor */} + {typeof movingIndex === 'number' && ( +
+ )} +
+ , ); };