Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Tabs scroll slowly in firefox some version such as 72.0

未关闭
#657 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react, typescript
领域
frontend

调研方向

首先在 Firefox 72.0 和 Firefox 109 中重现提供的 Tabs 示例,然后跟踪处理 wheel event 的标签页滚动路径。检查 deltaMode 的解释方式;当受影响的 Firefox 版本中的滚动不再缓慢,并且在较新版本中的行为仍然正确时,即可完成。

由索引模型根据 Issue 内容生成。

描述

Platform

  • OS: windows 11
  • browser: firefox 72.0

code

import React, { useState } from 'react';
import type { RadioChangeEvent } from 'antd';
import { Radio, Tabs } from 'antd';

type TabPosition = 'left' | 'right' | 'top' | 'bottom';

const App: React.FC = () => {
  const [mode, setMode] = useState<TabPosition>('top');

  const handleModeChange = (e: RadioChangeEvent) => {
    setMode(e.target.value);
  };

  return (
    <div>
      <Radio.Group onChange={handleModeChange} value={mode} style={{ marginBottom: 8 }}>
        <Radio.Button value="top">Horizontal</Radio.Button>
        <Radio.Button value="left">Vertical</Radio.Button>
      </Radio.Group>
      <Tabs
        defaultActiveKey="1"
        tabPosition={mode}
        style={{ height: 220 }}
        items={new Array(30).fill(null).map((_, i) => {
          const id = String(i);
          return {
            label: `Tab-${id}`,
            key: id,
            disabled: i === 28,
            children: `Content of tab ${id}`,
          };
        })}
      />
    </div>
  );
};

the behavior in firefox 72.0

https://user-images.githubusercontent.com/50828665/224318652-2c32a52c-b104-4d53-87ce-d57e522bb924.mp4

the expected behavior

the behavior in firefox 109

https://user-images.githubusercontent.com/50828665/224319025-92ea69e6-ff28-4201-9dd9-1db9a8d01be6.mp4

cause

'wheel' event has a property deltaMode representing the unit of the delta* values' scroll amount

主要语言
TypeScript
星标
573
派生
243
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react-component/tabs 的其他 Issue

查看 react-component/tabs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。