🐛 fix(detail): explicitly set preventScroll={true} on Tabs to stop page jump
Problem
Semi UI’s Tabs calls `focus()` on the active tab during mount, causing the browser to scroll the page to that element.
Using the bare `preventScroll` shorthand was not picked up reliably, so the page still jumped to the Tabs’ position on first render.
Changes
• Updated both Tabs instances in `web/src/pages/Detail/index.js` to `preventScroll={true}` instead of the shorthand prop.
• Ensures the prop is explicitly interpreted as boolean `true`, converting the internal call to `focus({ preventScroll: true })`.
Result
The `Detail` page now stays at its original scroll position after load, eliminating the unexpected auto-scroll behavior.
This commit is contained in:
@@ -1112,7 +1112,7 @@ const Detail = (props) => {
|
||||
</div>
|
||||
<Tabs
|
||||
type="button"
|
||||
preventScroll
|
||||
preventScroll={true}
|
||||
activeKey={activeChartTab}
|
||||
onChange={setActiveChartTab}
|
||||
>
|
||||
@@ -1389,7 +1389,7 @@ const Detail = (props) => {
|
||||
) : (
|
||||
<Tabs
|
||||
type="card"
|
||||
preventScroll
|
||||
preventScroll={true}
|
||||
collapsible
|
||||
activeKey={activeUptimeTab}
|
||||
onChange={setActiveUptimeTab}
|
||||
|
||||
Reference in New Issue
Block a user