Using groupBy filter with ng-repeat in template on iOS9 iPhone4 causes infinite repeating
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- angularjs, javascript
调研方向
这个 issue 涉及 groupBy 过滤器在 iOS9 iPhone4 上导致无限重复。首先检查 angular-filter 库中 groupBy 过滤器的实现。使用提供的模板代码,在 iOS9 模拟器或设备上复现该 bug。查找 iOS9 上 JavaScript 执行或 AngularJS digest 周期的差异。检查过滤器是否稳定,以及它是否会原地修改 array。修复可能需要确保过滤器输出是确定性的,并且不会触发无限的 $digest 循环。
由索引模型根据 Issue 内容生成。
描述
I found that when using the groupBy filter within the template with an ng-repeat that iPhone4 on iOS9 would infinitely repeat the data, causing it to crash the browser if there was a particularly large set of data. This behaviour didn't present on any other devices I was testing (desktop Chrome, FF, IE9+, Android device using Chrome browser) including an iPhone 4 on iOS8.
An example of the template code I was using is as follows (where groupingMonth is an attribute of data):
<div ng-repeat="group in data | groupBy: 'groupingMonth' | toArray:true | orderBy: '$key': true">
I ended up being able to resolve the problem for my current purposes by moving the filters into the controller, eg:
$scope.groupedData = $filter('orderBy')($filter('toArray')($filter('groupBy')($scope.data, 'groupingMonth'), true), '$key', true);
<div ng-repeat="group in groupedData">
Either the groupBy filter shouldn't be used in the ng-repeat and perhaps something documented to say as such would help others, or something has fundamentally changed with iOS9 which causes this behaviour regardless of how the filter is written. I investigated as much as I could but wasn't able to pin down why this behaviour presents in iOS9 and not iOS8. I used angular-filter v0.5.5 and tried upgrading to 5.5.8 with the same behaviour seen on both.
- 主要语言
- JavaScript
- 星标
- 2.9k
- 派生
- 319
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a8m/angular-filter 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
a8m/angular-filter#267 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
a8m/angular-filter#260 · 1 个 reaction ·
-
KiB and MiB are wrongly used in place of kB and MB可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
a8m/angular-filter#254 · 2 条评论 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 65/100
a8m/angular-filter#250 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
a8m/angular-filter#208 · 1 条评论 · 1 个 reaction ·
查看 a8m/angular-filter 的全部 Issue
相似的 Issue
-
check:passed logos:add
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 6 天内回复
-
cvss-severity:high devguard l3montree-cybersecurity/.../devguard-documentation pkg:oci/devguard-documen...ch=amd64&tag=main-amd64 risk:low state:open
难度 1/5 1 小时以内 新手友好度 75/100
l3montree-dev/devguard-documentation#365 · 1 条评论 ·
-
docs
难度 1/5 1-3 小时 新手友好度 82/100
idean3885/claude-ops-agent#811 ·
维护者通常 1 天内回复
-
external-plugin ready-for-review third party
难度 2/5 1-3 小时 新手友好度 68/100
github/awesome-copilot#5713 · 1 条评论 ·
维护者通常 1 天内回复
-
curriculum documentation quality
难度 2/5 1-3 小时 新手友好度 84/100
githubnext/gh-aw-workshop#5038 ·
维护者通常 1 天内回复