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

fix: Emit table select event only if selection changes #2196 #2201

Merged
merged 8 commits into from
Dec 7, 2023

Conversation

marek-mihok
Copy link
Contributor

@marek-mihok marek-mihok commented Nov 21, 2023

The PR fulfills these requirements: (check all the apply)

  • It's submitted to the main branch.
  • When resolving a specific issue, it's referenced in the PR's title (e.g. feat: Add a button #xxx, where "xxx" is the issue number).
  • When resolving a specific issue, the PR description includes Closes #xxx, where "xxx" is the issue number.
  • If changes were made to ui folder, unit tests (make test) still pass.
  • New/updated tests are included

Fixed by updating FluentUI to slightly newer version supporting custom onItemsChanged event callback fired after Fluent internal items are updated but before onSelectionChanged. This way we can prevent select event from being emitted anytime items are updated. Now the only way of firing the event is to select/deselect row or select/deselect all rows.

Both unit and visual regression tests pass after FluentUI update.

Screen.Recording.2023-11-30.at.17.26.19.mov

Closes #2196

@marek-mihok marek-mihok marked this pull request as ready for review November 22, 2023 11:13
Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

Thanks @marek-mihok. Needs some work.

Your demo still fires select events on search/filter action. It should not. The select event should solely be fired only when user selects a row or clicks select/deselect all.

py/examples/table_events_select.py Outdated Show resolved Hide resolved
ui/src/table.test.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@mturoci mturoci left a comment

Choose a reason for hiding this comment

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

Good job @marek-mihok!

@mturoci mturoci merged commit a0151cd into main Dec 7, 2023
2 checks passed
@mturoci mturoci deleted the feat/issue-2196 branch December 7, 2023 09:27
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.

Table select event prevents correct execution of other table events
2 participants