useWindowSize could return window width minus scrollbar
@omwagh28 已经在做这个了。
开始于 2024年7月16日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- frontend
调研方向
Start by reading the existing useWindowSize and useScrollbarWidth hooks to understand their current return values and scrollbar handling. Check how useWindowSize is tested, if tests are available, then add the proposed innerWidth and innerHeight values based on document.body.clientWidth and the corresponding height. Done means the hook exposes the new values with coverage for the scrollbar-related behavior.
由索引模型根据 Issue 内容生成。
描述
I realized useWindowSize returns the window's innerWidth which includes the scrollbar's width, if present, but also that I could use useScrollbarWidth to subtract it.
Why not add an innerWidth (and innerHeight) value to useWindowSize? It can be fetched using window.document.body.clientWidth.
- 主要语言
- TypeScript
- 星标
- 44k
- 派生
- 3.3k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
streamich/react-use 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
Add Generic Fn for useDebounce可能已有人在做 @itsmejay80 于 194 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 64/100
-
useVideo.story.tsx - sampleVideo can not be loaded可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 62/100
-
useSlider: event callbacks are not updated可能已有人在做 @erykpiast 于 1841 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
查看 streamich/react-use 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 82/100
source-cooperative/docs.source.coop#41 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
Nimblesite/SharpLsp#468 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
solidjs-community/solid-primitives#1082 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复