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

Add patient details button is jumping when we open advanced patient filters #4353

Closed
rithviknishad opened this issue Dec 18, 2022 · 5 comments · Fixed by #4376
Closed

Add patient details button is jumping when we open advanced patient filters #4353

rithviknishad opened this issue Dec 18, 2022 · 5 comments · Fixed by #4376
Assignees

Comments

@rithviknishad
Copy link
Member

rithviknishad commented Dec 18, 2022

Describe the bug
In the patients' list page, the add patient details button is jumping when we open Advanced Filters.

To Reproduce
Steps to reproduce the behavior:

  1. Go to patients list page
  2. Open advanced filters

Expected behavior
It shouldn't jump.

Screenshots

output.mp4
@khavinshankar khavinshankar self-assigned this Dec 19, 2022
@khavinshankar
Copy link
Member

@rithviknishad
The jumping around seems to be caused because of the useExport hook. We are exporting ExportMenu and ExportButton JSX components from the useExport hook, so as the useExport hook is called at every render, these also are changing (function signatures) and rerendered. The jumping is because of the difference in time taken to render the icons used inside the 2 above-mentioned functions.

I think converting the hook to a component should fix it, what are ur thoughts?

@rithviknishad
Copy link
Member Author

@khavinshankar I understood the problem. I should make sure I stop inlining components 😅

Btw, do you mean to refactor out the ExportMenu, ExportButton, and _CSVLink outside of the hook?

Or to create two components ExportMenu, and ExportButton that replicates the functionality of the useExport hook inside it?

@khavinshankar
Copy link
Member

@rithviknishad something of that sort

@rithviknishad
Copy link
Member Author

@khavinshankar I think it should work, but I wonder how it also affects the add patient details button too?

@naman114
Copy link
Contributor

The buttons seem to be jumping on several screens when the sidebar is opened

2022-12-19_23-50-57.mp4

@gigincg @khavinshankar @rithviknishad

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

Successfully merging a pull request may close this issue.

3 participants