Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb66c1d6

Browse files
authored
Remove layout-router sticky/fixed debug warning (#85193)
Fixes an issue that reproduces due to a combination of the logforwarding logic alongside logging out an explicit element. We can addthis back in the future once our log forwarding library properly ignoresnon-enumerable properties.
1 parent96754b6 commitb66c1d6

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

‎packages/next/src/client/components/layout-router.tsx‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ function shouldSkipElement(element: HTMLElement) {
140140
// and will result in a situation we bail on scroll because of something like a fixed nav,
141141
// even though the actual page content is offscreen
142142
if(['sticky','fixed'].includes(getComputedStyle(element).position)){
143-
if(process.env.NODE_ENV==='development'){
144-
console.warn(
145-
'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',
146-
element
147-
)
148-
}
149143
returntrue
150144
}
151145

‎test/e2e/app-dir/router-autoscroll/router-autoscroll.test.ts‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -197,20 +197,6 @@ describe('router autoscrolling on navigation', () => {
197197
.click()
198198
.waitForElementByCss('#content-that-is-visible')
199199
awaitcheck(()=>browser.eval('window.scrollY'),0)
200-
201-
if(isNextDev){
202-
// Check that we've logged a warning
203-
awaitcheck(async()=>{
204-
constlogs=awaitbrowser.log()
205-
returnlogs.some((log)=>
206-
log.message.includes(
207-
'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:'
208-
)
209-
)
210-
?'success'
211-
:undefined
212-
},'success')
213-
}
214200
})
215201

216202
it('Should scroll to the top of the layout when the first child is position sticky',async()=>{
@@ -221,20 +207,6 @@ describe('router autoscrolling on navigation', () => {
221207
.click()
222208
.waitForElementByCss('#content-that-is-visible')
223209
awaitcheck(()=>browser.eval('window.scrollY'),0)
224-
225-
if(isNextDev){
226-
// Check that we've logged a warning
227-
awaitcheck(async()=>{
228-
constlogs=awaitbrowser.log()
229-
returnlogs.some((log)=>
230-
log.message.includes(
231-
'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:'
232-
)
233-
)
234-
?'success'
235-
:undefined
236-
},'success')
237-
}
238210
})
239211

240212
it('Should apply scroll when loading.js is used',async()=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp