Sticky behavior breaks in editor with parent overflow: auto
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Problem Statement
When the editor is placed inside a parent container with overflow: auto, the condition at this line (refPageOffset <= stickyOffset) fails to trigger, causing the sticky header functionality to stop working as expected.
Possible Solutions
-
Utilizing Intersection Observer API:
We can explore using the Intersection Observer API to detect when elements enter or exit the viewport. This method would involve observing multiple elements, including those that might dynamically change. However, elements withposition: stickymay not trigger the observer effectively due to their inherent visibility within the viewport. -
Direct Position Comparison:
A simpler approach might involve directly comparing the initial top position of therefcomponent with thewindowscroll position or the scroll position of the nearest parent which hasoverflow: autoor window.
Key Considerations
- Handling Dynamic DOM Changes: It's crucial to account for elements that might be added to the DOM at runtime, as these could disrupt the layout and the sticky behavior.
- Flexible Offset Management: Introducing a CSS variable for the sticky offset allows for more fine-tuned control across different layouts and components, enhancing maintainability and adaptability in varied environments.
- 主要语言
- TypeScript
- 星标
- 428
- 派生
- 48
- 平均合并
- 5 天 15 小时
- 30 天内合并 PR
- 47
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gravity-ui/markdown-editor 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
gravity-ui/markdown-editor#1452 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
gravity-ui/markdown-editor#1293 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
gravity-ui/markdown-editor#1129 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
gravity-ui/markdown-editor#1450 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
gravity-ui/markdown-editor#1331 ·
维护者通常 1 天内回复
查看 gravity-ui/markdown-editor 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
tintinweb/pi-subagents#459 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
danielmiessler/LifeOS#2830 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
freshframework/fresh#3920 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area: client enhancement priority: low
难度 2/5 1-3 小时 新手友好度 75/100
opensro-dev/opensro#3681 ·
维护者通常 1 天内回复