We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3c3610 commit 1611f85Copy full SHA for 1611f85
ui/src/pages/Questions/Detail/index.tsx
@@ -265,13 +265,11 @@ const Index = () => {
265
});
266
267
268
- // 检查当前URL是否包含锚点,如果有,自动滚动到正确位置
269
if (window.location.hash) {
270
const { hash } = window.location;
271
const targetElement = document.getElementById(hash.substring(1));
272
273
if (targetElement) {
274
- // 给浏览器一点时间来完成渲染
275
setTimeout(() => {
276
scrollToElementTop(targetElement);
277
}, 100);
@@ -291,7 +289,6 @@ const Index = () => {
291
289
attributeFilter: ['id', 'href'],
292
290
293
294
- // 监听 URL hash 变化
295
const handleHashChange = () => {
296
297
0 commit comments