🐛 fix(model-test-modal): keep Modal mounted to restore body overflow correctly

Previously the component unmounted the Modal as soon as `showModelTestModal` became
false, preventing Semi UI from running its cleanup routine. This left `body`
stuck with `overflow: hidden`, disabling page scroll after the dialog closed.

Changes made
– Removed the early `return null` and always keep the Modal mounted; visibility
  is now controlled solely via the `visible` prop.
– Introduced a `hasChannel` guard to safely skip data processing/rendering when
  no channel is selected.
– Added defensive checks for table data, footer and title to avoid undefined
  access when the Modal is hidden.

This fix ensures that closing the test-model dialog correctly restores the
page’s scroll behaviour on both desktop and mobile.
This commit is contained in:
t0ng7u
2025-07-19 11:34:34 +08:00
parent 635bfd4aba
commit f3bcf570f4
3 changed files with 16 additions and 16 deletions

View File

@@ -440,7 +440,7 @@ const SiderBar = ({ onNavigate = () => { } }) => {
/>
}
onClick={toggleCollapsed}
iconOnly={collapsed}
icononly={collapsed}
style={collapsed ? { padding: '4px', width: '100%' } : { padding: '4px 12px', width: '100%' }}
>
{!collapsed ? t('收起侧边栏') : null}