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: prevent scrolling on user modal (WPB-4472) #15853

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/script/components/Modals/UserModal/UserModal.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/

import {css} from '@emotion/react';
import {CSSObject, css} from '@emotion/react';

export const userModalStyle = css`
.enriched-fields {
Expand Down Expand Up @@ -50,11 +50,16 @@ export const userModalStyle = css`
}

.modal__body {
padding: 16px;
padding: 0 16px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the vertical padding brings us closer to the design specs


.classified-bar {
margin-top: 12px;
width: calc(100% + 32px);
}
}
`;

export const userModalWrapperStyle: CSSObject = {
maxHeight: '90vh',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

an other option would be fit-content, 90vh allows makes it more obvious the component is a modal on smaller windows
image

padding: 0,
};
6 changes: 2 additions & 4 deletions src/script/components/Modals/UserModal/UserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {handleKeyDown} from 'Util/KeyboardUtil';
import {replaceLink, t} from 'Util/LocalizerUtil';

import {useUserModalState} from './UserModal.state';
import {userModalStyle} from './UserModal.styles';
import {userModalStyle, userModalWrapperStyle} from './UserModal.styles';

import {Config} from '../../../Config';
import {User} from '../../../entity/User';
Expand Down Expand Up @@ -181,9 +181,7 @@ const UserModal: React.FC<UserModalProps> = ({
onBgClick={hide}
onClosed={onModalClosed}
data-uie-name={user ? 'modal-user-profile' : userNotFound ? 'modal-cannot-open-profile' : ''}
wrapperCSS={{
padding: 0,
}}
wrapperCSS={userModalWrapperStyle}
>
<div className="modal__header">
{userNotFound && (
Expand Down
Loading