Skip to content

fix: #12595 - Two onSort emits were triggered, when both sortField and sortOrder changed at once#18971

Open
EstelonAgarwaen wants to merge 1 commit intoprimefaces:masterfrom
EstelonAgarwaen:only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order
Open

fix: #12595 - Two onSort emits were triggered, when both sortField and sortOrder changed at once#18971
EstelonAgarwaen wants to merge 1 commit intoprimefaces:masterfrom
EstelonAgarwaen:only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order

Conversation

@EstelonAgarwaen
Copy link

@EstelonAgarwaen EstelonAgarwaen commented Oct 2, 2025

Fixes: #12595

When using p-table with lazy=true and setting the sortOrder and sortField-Inputs, the onSort-Emitter emitted two events.

This PR fixes that issue, so that no matter which constellation of changes these inputs receive, there will be one emit on the onSort-emitter.

@EstelonAgarwaen EstelonAgarwaen changed the title 12595: fixes issue of two onSort emits when both sortOrder and sortFi… #12595: fixes issue of two onSort emits when both sortOrder and sortFi… Oct 2, 2025
@EstelonAgarwaen EstelonAgarwaen changed the title #12595: fixes issue of two onSort emits when both sortOrder and sortFi… 12595: fixes issue of two onSort emits when both sortOrder and sortField inputs change at once Oct 2, 2025
@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 5a1ff15 to 506567d Compare October 8, 2025 11:42
@EstelonAgarwaen EstelonAgarwaen changed the title 12595: fixes issue of two onSort emits when both sortOrder and sortField inputs change at once fixes issue of two onSort emits when both sortOrder and sortField inputs change at once Oct 9, 2025
@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 506567d to 34e6653 Compare October 29, 2025 10:22
Copy link
Contributor

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

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

Fix makes sense. Have some minor comments.

Nice to see some more tests for the sorting!
I can confirm that one test fails before and passes after. The other tests pass before and after, as expected.

@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 2160b40 to 8e89a6f Compare October 30, 2025 10:17
@EstelonAgarwaen EstelonAgarwaen changed the title fixes issue of two onSort emits when both sortOrder and sortField inputs change at once fix: #12595 - Two onSort emits were triggered, when both sortField and sortOrder changed at once Oct 30, 2025
@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 8e89a6f to 9eaea0b Compare October 30, 2025 10:21
Copy link
Contributor

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

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

Looks good now!

@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 9eaea0b to 95bc1eb Compare November 13, 2025 11:39
@EstelonAgarwaen EstelonAgarwaen force-pushed the only-emit-single-sort-event-when-using-inputs-for-sort-field-and-order branch from 95bc1eb to b3f44b5 Compare March 9, 2026 15:27
Copy link
Contributor

@Maran23 Maran23 left a comment

Choose a reason for hiding this comment

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

Still good. Hope there will be an official review at one point. Thanks for changing it to the new testing approach.

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.

p-table emits multiple lazyLoading events when we have dynamic [sortField]

2 participants