Skip to content

[Bug]: SortAndPage does not work when there is only 1 page #964

Description

@insomniachi

Describe the bug 🐞

When there is only 1 page, the sorting does not happen.
if i change the page size so that there is more than 1 page, then sorting works

var pageRequest = this.WhenAnyValue(x => x.SelectedPage).Select(page => new PageRequest(page + 1, 100));
var comparer = this.WhenAnyValue(x => x.SortBy, x => x.Order).Select(GetComparer);

_itemsCache
	.Connect()
	.RefCount()
	.SortAndPage(comparer, pageRequest)
	.Bind(out _items)
	.DisposeMany()
	.Subscribe();

Step to reproduce

See description

Reproduction repository

https://github.com/reactivemarbles/DynamicData

Expected behavior

Sorting should happen even if there is only 1 page

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows

Version

11

Device

No response

DynamicData Version

9.0.4

Additional information ℹ️

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions