adopted-ember-addons / adopted-ember-addons/ember-collection

Yield content block before/after loop

未關閉
#152 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
235
分支
81
PR 合併指標
30 天內沒有已合併 PR

描述

I've found myself needing to add some content *inside* the scroll area, but *before/after* the loop. Maybe this isn't a common need, because I'm guessing in most cases this would mess with the DOM calculations.

In this case, however, I needed to inject a div for an ember-wormhole destination after the items, but inside the scroll container. This helps the content (dropdown menus) scroll with the collection view.

In the meantime, I've subclassed ember-collection to override the component template and add my own wormhole destination:

```hbs
{{#ember-native-scrollable content-size=_contentSize scroll-left=_scrollLeft scroll-top=_scrollTop scrollChange=(action "scrollChange") clientSizeChange=(action "clientSizeChange")}}


{{~#each _cells as |cell|~}}
{{yield cell.item cell.index }}

{{~/each~}}

{{!-- This is where all wormholed elements from collection items will appear --}}

{{/ember-native-scrollable}}
```

Would we be open to allowing users to add their own content there?

Is there a better way to accomplish this?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。