Skip to content

Commit

Permalink
Fix plugin scrollbar (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 authored Jun 19, 2024
1 parent 551d00e commit bc33c0e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
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;
}

0 comments on commit bc33c0e

Please sign in to comment.