`Surface.View` can not access context
还没有人认领这个 Issue。
评估
调研方向
Start with lib/surface/compiler/eex_engine.ex around lines 1095-1100, identified as the culprit, and reproduce the issue using a Surface initialized with --layouts and context in live.sface or a used component. Done means the context value is read correctly instead of returning nil; the issue does not name a test to run.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When using the context in a template defined inside a Surface.View, both (old) <Context get={...}> and (new) prop name, :type, from_context: ... in a used component yields nil.
How to reproduce it
- Use surface initialized with
--layouts - Use context in
live.sfaceor a component used bylive.sface - Resulting value will always be
nil
The behavior you expected
The value is read correctly.
Your Environment
Surface: v0.8.1
LiveView: v0.17.11
Elixir: v1.14.0
Culprit
I tracked down the issue to the following line: https://github.com/surface-ui/surface/blob/b9675f9662f9d684ad4baeebdcc358ffab5264b2/lib/surface/compiler/eex_engine.ex#L1095-L1100
Since this looks like the context is intentionally set to an empty map, I decided not to attempt a PR for now.
Workaround
I built the component inclusion manually, for now, to work around the constraint / issue:
- 主要语言
- Elixir
- 星标
- 2.1k
- 派生
- 146
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
surface-ui/surface 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 78/100
surface-ui/surface#634 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
surface-ui/surface#770 ·
-
Website is down未关闭
难度 4/5 3-5 天 新手友好度 35/100
surface-ui/surface#768 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
surface-ui/surface#762 · 2 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
surface-ui/surface#759 · 1 个 reaction ·
查看 surface-ui/surface 的全部 Issue
相似的 Issue
-
Assigns view shows list and tuple elements in sorted order instead of their real order可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
software-mansion/live-debugger#1011 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
hexlet-codebattle/codebattle#2362 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
intellij-elixir/intellij-elixir#4501 ·
维护者通常 1 天内回复