Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[very WIP] Filter-overflow-group: Events #4299

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

margaree
Copy link
Contributor

Rally

The change events pass through as expected now. The load more and search are much more complex (will add comments).

Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-4299/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@d2l-filter-dimension-search=${this._handleSearch}>
${repeat(this._dimensions, dimension => dimension.key, dimension => this._renderDimensionSet(dimension))}
</d2l-filter>
<d2l-filter-overflow-group max-to-show="1">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just modified temporarily to work on search and load more.

@@ -105,9 +116,27 @@ class FilterOverflowGroup extends OverflowGroupMixin(RtlMixin(LitElement)) {
if (!filterSetValue) return;
filterSetValue.selected = change.selected;
});

this._getFilterParent(e.target.classList, filterSet)?.requestFilterChangeEvent(e.detail.allCleared, [dimension], { overflowEvent: true });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a filter change event happens on the overflow filter, the original filter that is currently hidden is then found and the change event is triggered on it.

Would need to test and make sure that if a change handler on the original filter changed something within that original filter that it is then reflected to overflow group filter.

if (!filterSet) return;
const filter = this._getFilterParent(e.target.classList, filterSet);
filter.requestFilterLoadMoreEvent(e.detail.key, e.detail.value, e.detail.loadMoreCompleteCallback);
this._handleSlotChange();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this when load more and search occurred did refresh the overflow group filter contents, but also some features were missing like having the selected items at the top of the list, and on search the selected items were all still visible. This can likely be simplified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant