-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from MaTeMaTuK/dev
vertical scroll fix
- Loading branch information
Showing
12 changed files
with
4,398 additions
and
8,598 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "gantt-task-react", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Interactive Gantt Chart for React with TypeScript.", | ||
"author": "MaTeMaTuK <[email protected]>", | ||
"homepage": "https://github.com/MaTeMaTuK/gantt-task-react", | ||
|
@@ -39,15 +39,15 @@ | |
"react": "^16.0.0" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.5.0", | ||
"@testing-library/user-event": "^7.2.1", | ||
"@types/jest": "^25.1.4", | ||
"@types/node": "^12.20.4", | ||
"@types/react": "^16.14.4", | ||
"@types/react-dom": "^16.9.11", | ||
"@typescript-eslint/eslint-plugin": "^4.7.0", | ||
"@typescript-eslint/parser": "^4.7.0", | ||
"@testing-library/jest-dom": "^5.12.0", | ||
"@testing-library/react": "^11.2.6", | ||
"@testing-library/user-event": "^13.1.8", | ||
"@types/jest": "^26.0.23", | ||
"@types/node": "^15.0.1", | ||
"@types/react": "^17.0.4", | ||
"@types/react-dom": "^17.0.3", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"babel-eslint": "^10.0.3", | ||
"cross-env": "^7.0.3", | ||
"eslint-config-prettier": "^6.15.0", | ||
|
@@ -59,7 +59,7 @@ | |
"eslint-plugin-promise": "^4.3.1", | ||
"eslint-plugin-react": "^7.22.0", | ||
"eslint-plugin-standard": "^4.1.0", | ||
"gh-pages": "^2.2.0", | ||
"gh-pages": "^3.1.0", | ||
"microbundle-crl": "^0.13.11", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.2.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.scroll { | ||
overflow: auto; | ||
max-width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { SyntheticEvent, useRef, useEffect } from "react"; | ||
import styles from "./horizontal-scroll.module.css"; | ||
|
||
export const HorizontalScroll: React.FC<{ | ||
scroll: number; | ||
svgWidth: number; | ||
taskListWidth: number; | ||
onScroll: (event: SyntheticEvent<HTMLDivElement>) => void; | ||
}> = ({ scroll, svgWidth, taskListWidth, onScroll }) => { | ||
const scrollRef = useRef<HTMLDivElement>(null); | ||
|
||
useEffect(() => { | ||
if (scrollRef.current) { | ||
scrollRef.current.scrollLeft = scroll; | ||
} | ||
}, [scroll]); | ||
|
||
return ( | ||
<div | ||
style={{ marginLeft: taskListWidth }} | ||
className={styles.scroll} | ||
onScroll={onScroll} | ||
ref={scrollRef} | ||
> | ||
<div style={{ width: svgWidth, height: 1 }} /> | ||
</div> | ||
); | ||
}; |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
src/components/other/scroll.tsx → src/components/other/vertical-scroll.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters