Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Task
Chakra-ui uses this lib under the hood https://github.com/theKashey/react-remove-scroll
The problem is that it disables scrolling everywhere except for the current modal. drawer, according to chakra, is also a modal. and the scrolling block will apply to only one layer of nesting.
so, since dynamic modal content resides close to the root in DOM it is considered a lower level modal window by chakra and the scrolling blocks because of that when you open a drawer.
if you set
blockScrollOnMount={false}
for the drawers it'll fix the issue for scrolling inside the modal, but everything else will also become scrollable (like accounts list).That's why I just disable this functionality provided by chakra for drawers and set it manually for the dynamic modal so that everything except for it is non-scrollable while it's open.
Also, I noticed that if you have lots of errors happening at the same time you could end up with repeated keys on the errors drawer. so, I used the same approach as with the batch page - nanoid. yes, it might cause rer-enders of all of the elements if they change anyhow, but:
Types of changes
Steps to reproduce
Screenshots
Add the screenshots of how the app used to look like and how it looks now
Checklist