Просмотр исходного кода

🛠️ fix(detail): disable automatic page scroll caused by Tabs focus

The initial render of the `Detail` page was jumping to the first `Tabs` component because Semi UI calls `focus()` on the active tab, which triggers the browser’s default scroll-into-view behavior.

Changes made
• Added `preventScroll` to the chart-selector `Tabs` (type="button").
• Added `preventScroll` to the uptime-monitor `Tabs` (type="card").

These flags convert the internal `focus()` call to `focus({ preventScroll: true })`, allowing the page to stay at its current position after load.

No functional logic is changed other than disabling the unwanted scroll; UI and user interactions remain the same.
Apple\Apple 8 месяцев назад
Родитель
Сommit
3502730dfc
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      web/src/pages/Detail/index.js

+ 2 - 0
web/src/pages/Detail/index.js

@@ -1112,6 +1112,7 @@ const Detail = (props) => {
                   </div>
                   <Tabs
                     type="button"
+                    preventScroll
                     activeKey={activeChartTab}
                     onChange={setActiveChartTab}
                   >
@@ -1388,6 +1389,7 @@ const Detail = (props) => {
                         ) : (
                           <Tabs
                             type="card"
+                            preventScroll
                             collapsible
                             activeKey={activeUptimeTab}
                             onChange={setActiveUptimeTab}