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 plugin scrollbar #181

Merged
merged 1 commit into from
Jun 19, 2024
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
5 changes: 5 additions & 0 deletions .changeset/few-apes-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"penpot-exporter": patch
---

Fix scrollbar showing up randomly
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions ui-src/components/Wrapper/Wrapper.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.wrapper {
padding: 1.5rem 1rem 1rem;

.wrapper-overflow {
/* Empty class used to detect overflow on the body */
}
}
7 changes: 1 addition & 6 deletions ui-src/components/Wrapper/Wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import classNames from 'classnames';
import { CSSProperties, PropsWithChildren, forwardRef } from 'react';

import styles from './Wrapper.module.css';
Expand All @@ -11,11 +10,7 @@ type WrapperProps = PropsWithChildren & {
const Wrapper = forwardRef<HTMLDivElement, WrapperProps>(
({ style, overflowing = false, children }: WrapperProps, ref) => {
return (
<div
ref={ref}
className={classNames({ [styles.wrapper]: true, [styles.wrapperOverflow]: overflowing })}
style={style}
>
<div ref={ref} className={styles.wrapper} style={style} data-overflowing={overflowing}>
{children}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion ui-src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Penpot Exporter</title>
</head>
<body>
<body style="overflow-y: hidden">
<div id="root"></div>
<script type="module" src="./main.tsx"></script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions ui-src/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
body :not:has(.wrapper-overflow) {
overflow-y: hidden;
body:has(div[data-overflowing='true']) {
overflow-y: visible !important;
}