-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(react-drawer): update drawer scroll state when content changes #35210
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
base: master
Are you sure you want to change the base?
fix(react-drawer): update drawer scroll state when content changes #35210
Conversation
📊 Bundle size report
Unchanged fixtures
|
Pull request demo site: URL |
@@ -1 +1,3 @@ | |||
/** Jest test setup file. */ | |||
const ResizeObserver = require('resize-observer-polyfill'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First time we use ResizeObserver for our components, so we need to mock it for the test env since Jest doesn't support ResizeObserver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make sure that it's get picked up by react-integration-tester (rit)?
"@fluentui/scripts-api-extractor": "*", | ||
"@fluentui/scripts-cypress": "*" | ||
"@fluentui/scripts-cypress": "*", | ||
"resize-observer-polyfill": "1.5.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following the monorepo single version policy, so we should probably add this to the root package.json as well, correct @Hotell?
Previous Behavior
DrawerBody was not accounting for content change to calculate the scroll state, that is responsible to define the separator.
New Behavior
DrawerBody now has a ResizeObserver to detect when the content changes, at least for when the height changes.
Related Issue(s)
Drawer
scrollState
does not update whenDrawerBody
content changes size #34324