Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7189949
Update dependency react-draggable to v4.4.4 (#819)
renovate[bot] Feb 26, 2022
b70dcd1
Update dependency sinon to v12 (#838)
renovate[bot] Feb 26, 2022
c328a91
Update dependency typescript to v4.5.2 (#731)
renovate[bot] Feb 26, 2022
4bc9f54
Bump path-parse from 1.0.5 to 1.0.7 (#817)
dependabot[bot] Feb 26, 2022
60c47be
re-resizable 6.9.2
bokuweb Feb 26, 2022
a706078
10.3.6
bokuweb Feb 26, 2022
ab5a2a8
Update README.md
bokuweb Feb 27, 2022
c3480d1
Bump trim-off-newlines from 1.0.1 to 1.0.3 (#848)
dependabot[bot] Feb 28, 2022
e6f2012
Update dependency @types/node to v16 (#837)
renovate[bot] Feb 28, 2022
d2e7ae5
Update dependency @types/react-dom to v17.0.11 (#835)
renovate[bot] Feb 28, 2022
7c38381
Update dependency tslib to v2.3.1 (#818)
renovate[bot] Feb 28, 2022
792a48e
Update dependency @types/sinon to v10.0.11 (#830)
renovate[bot] Mar 8, 2022
ae222f7
Update dependency prettier to v2.5.1 (#826)
renovate[bot] Mar 8, 2022
40a7962
Update storybook monorepo to v6.4.19 (#815)
renovate[bot] Mar 8, 2022
a06ac05
Update babel monorepo (#814)
renovate[bot] Mar 8, 2022
014460d
Update dependency @types/react to v17 (#758)
renovate[bot] Mar 8, 2022
73d118a
Update dependency @types/react to v17.0.43 (#855)
renovate[bot] Apr 1, 2022
572df7a
Update dependency typescript to v4.6.3 (#851)
renovate[bot] Apr 1, 2022
57e93e1
Update dependency re-resizable to v6.9.5 (#859)
renovate[bot] Apr 13, 2022
6018146
Update dependency sinon to v13 (#854)
renovate[bot] Apr 13, 2022
042eb3d
Update dependency @types/react-dom to v17.0.15 (#852)
renovate[bot] Apr 13, 2022
18dc153
fix: add missing peer dependencies `react` and `react-dom` (#864)
merceyz Apr 17, 2022
1e36a39
10.3.7 (#865)
bokuweb Apr 17, 2022
2976b18
Update dependency prettier to v2.6.2 (#863)
renovate[bot] Apr 17, 2022
74f5529
Update README.md
bokuweb Apr 17, 2022
2cbd5dd
fix: update react-draggable to 4.4.5 (#873)
renambot Sep 11, 2022
ade3d7a
Bump terser from 4.6.2 to 4.8.1 (#875)
dependabot[bot] Sep 11, 2022
9694035
Bump async from 2.6.1 to 2.6.4 (#866)
dependabot[bot] Sep 11, 2022
1e68abe
Update dependency cpy-cli to v4 (#853)
renovate[bot] Sep 11, 2022
a360a4a
Bump loader-utils from 1.2.3 to 1.4.1 (#883)
dependabot[bot] Nov 15, 2022
5abea8e
chore(deps): update dependency @types/react-dom to v17.0.18 (#881)
renovate[bot] Nov 15, 2022
f4d798c
Bump css-what from 2.1.0 to 2.1.3 (#879)
dependabot[bot] Nov 15, 2022
fe03a7d
chore(deps): update dependency cpy-cli to v4.2.0 (#876)
renovate[bot] Nov 15, 2022
cc1d7ef
chore(deps): update dependency @types/node to v16.18.3 (#867)
renovate[bot] Nov 15, 2022
36d3506
chore(deps): update storybook monorepo to v6.5.13 (#862)
renovate[bot] Nov 15, 2022
2493bd7
feat: bounds accept HTMLElement (#890)
tsuk29 Dec 18, 2022
465b3e9
10.4.0 (#896)
bokuweb Dec 18, 2022
50f5894
10.4.1
bokuweb Dec 19, 2022
5a221a5
Update README.md
bokuweb Dec 19, 2022
42948d0
fix: storybook wont start and causes in ModuleBuildError ('loose' mod…
alimpam Apr 16, 2023
41af2b8
Fix 910 (#924)
bokuweb Apr 20, 2024
0940631
fix: update (#925)
bokuweb Apr 20, 2024
f03d5c4
10.4.6 (#927)
bokuweb Apr 21, 2024
44976a9
chore: add example (#929)
bokuweb Apr 21, 2024
dc78a01
Update README.md
bokuweb Apr 21, 2024
706b842
chore(deps): replace dependency npm-run-all with npm-run-all2 5.0.0 (…
renovate[bot] Apr 21, 2024
dd49527
chore(deps): replace dependency rollup-plugin-babel with @rollup/plug…
renovate[bot] Apr 21, 2024
573e591
fix: #914 (#931)
bokuweb Apr 21, 2024
ec47e8f
10.4.7 (#933)
bokuweb Apr 21, 2024
9a0d2c2
chore(deps): replace dependency rollup-plugin-node-resolve with @roll…
renovate[bot] Apr 21, 2024
29c8f39
10.4.10 (#935)
bokuweb Apr 21, 2024
a5bf232
chore(deps): update dependency @types/node to v16.18.96 (#934)
renovate[bot] Apr 21, 2024
87c5f9e
chore(deps): update dependency npm-run-all2 to v5.0.2 (#936)
renovate[bot] Apr 21, 2024
3ea15b1
env: use pnpm (#938)
bokuweb Apr 21, 2024
980da5f
chore(deps): update react monorepo (#937)
renovate[bot] Apr 24, 2024
5467c08
chore(deps): update storybook monorepo to v6.5.16 (#939)
renovate[bot] Apr 25, 2024
5f5d2e7
Define callback refs inline to work with latest versions of Next.js /…
jmurty May 26, 2024
23d312c
10.4.11
bokuweb May 26, 2024
d12a19c
Fix 945 (#948)
bokuweb Aug 3, 2024
eb760a9
Update README.md
bokuweb Aug 6, 2024
e869e5f
Update re resizable 0922 (#950)
bokuweb Sep 21, 2024
66b69a9
Bump [email protected] (#957)
akphi Dec 18, 2024
0c8a8de
10.4.14 (#958)
bokuweb Feb 23, 2025
83b7229
Add missing position offset prop (#962)
sauravexodus Feb 23, 2025
872dbf0
10.5 (#965)
bokuweb Feb 23, 2025
2d74c9f
10.5.1 (#966)
bokuweb Feb 23, 2025
319a077
Update README.md
bokuweb Feb 23, 2025
da60836
fix: update re-resizable (#967)
binhpv Feb 26, 2025
34ccbfa
update package.json (#968)
bokuweb Feb 26, 2025
c9ec654
fix: update react-draggable (#979)
binhpv Jan 1, 2026
2701f43
Fix: prevent default behavior in drag and resize events (#973)
martinboksa Jan 1, 2026
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
54 changes: 30 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@ on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 12
- name: yarn
run: yarn --frozen-lockfile
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 9
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: lint
run: yarn lint
run: pnpm lint

tsc:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 12
- name: yarn
run: yarn --frozen-lockfile
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 9
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: tsc
run: yarn tsc
run: pnpm tsc

test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 12
- name: yarn
run: yarn --frozen-lockfile
- name: test
run: |
export DISPLAY=:99
Xvfb -ac :99 -screen 0 1280x1024x24 >/dev/null 2>&1 &
yarn run test
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - uses: actions/setup-node@master
# with:
# node-version: 20
# - name: yarn
# run: yarn --frozen-lockfile
# - name: test
# run: |
# export DISPLAY=:99
# Xvfb -ac :99 -screen 0 2080x1024x24 >/dev/null 2>&1 &
# yarn run test
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<img src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg" /></a>
<a href="https://github.com/prettier/prettier">
<img src="https://img.shields.io/badge/styled_with-prettier-ff69b4.svg" /></a>
<a href="https://bokuweb.github.io/react-rnd/stories">
<img src="https://camo.githubusercontent.com/302badad5b2c7f7fa0929dadc1ca0ca7cdf2e8f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73746f7279626f6f6b2d72656163742d3030643866662e7376673f636f6c6f72413d653136313863266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e53556845556741414144454141414179434159414141443143444f794141414141584e535230494172733463365141414141526e51553142414143786a777638595155414141414a6345685a6377414144734d41414137444163647671475141414158305355524256476844375a6c7262425256464d66506e6666757a72623067566751553651594c425574425931457742636153535434494349314367676d4b6e345341686a6b6736434a565a517678432f794d694342524979474742494450694a6f524155667142686549744241433561793233334d7a6f7a337a6836774f4a325a75374f376f54482b6d736e39337a76623766336678376c6e707642666747423552646d335a667659786d6d54683971325853744a55723356666736366c7134445652416861356d4e456845367174597666426f2f37714a6b4a72352b634b452b4b464952723956693846656d70796b7571324259356943426b446f6259414439513030793752527461355945555241415a4175676d6e5641486e633969547a7a674a6a2f4a67447231466c494c4632504e5963446c6573574e4b463245576a69777079565937717a36516c525352466f4278706f52796f743236366974356f6b316857415774704a42623949796865466f64777a4272535a64324b7463424e4f4c2f7967552f79524c7175723649692b7159725373375273705a3266517139723657313252616b4231766c514268696b496f6f714849456d364a535848614a72546d6b65504f475568524a7377725936554a594e45744d67732f554c534c3632425a497233734e5766674a4e304431774847585a53472f2b44444937396a7261504e494f79655762484d304c78307a516256746d374b3445716a7832786b44465236434a6a4a6c445651414341574641444b52523961446333517a712f654e6f42476f4761665177495045496671683042496259784a79564330336262734e71494d72454730475a6367734956773341466a66576d533749664c67486a4b392b785a5a41696775784675647149705578694331724257335776623447474f782b5a4e3455694c30344131754b493967455235416c455a56323644455136362f47466a3745686947674c333853612b454a4e474661316b6d556e7167503377374377457173465959777042626b6c6846594330656769616973744b5073453649706f4577616a6256776145394d5268574f51424e5a303054564e394c4e772b6d3638503461746f6d7a4f2f6542656577307472686845617559314350515245633634627370784748652b38424a354a61736866536d585a42386553506b39682f474f32366b6b554e5246553667696147787175395139676d70306c4735796631386a475751574b4d6e3877653755626b52427670484e44384354644463435a5548707666396630637275374d626c5275575034556c384c41374e36744e46346c774161737531476e6a515a3136473962634a462f64444f6168552f6b4b49666b395a4f54417068666b3648347a544c42706166646b584f6c484c346f373749353064374c436333636265333542315465784a544e4175573973766b4b58566d37664957655a73625462504e774f3576457a7a7437784d5242496f496d7832396f53644c6f387a323057665877375145646665335153364b2f4d426e4677445461576c6b41546a4b444d49376e7966565465434858564546737843364c5054334e4f2b464a5345685057795535496239794a4e582b6b35754551587a33667957704c425a634a6b5244636d64356b642b3248314e76627352614d4e764d75694332596a7258694b4d6c4d584d5459657841536939654131584565572f775247362b6c6d652f6a7a72347042693454675764464c3968475479783642314962506e4643615242692f53445148706d41745842776d54424d7377736c4e38626e50304c332f4e5667374436414c64346f394d6d504a5a4a6834544b6853664a504b4e327774655a31305a6c4972646b4250573162615a3031654b506363524f71777546616a4f646e76374752467133353275586f62584d39527a4778614133597159796a685a6f4b30462b66352b692b734537535a50476c793937363961613445357468574e37704f4e46704775317867664c5053304872624464397076592b33556c4e484658683843306e556634657052752f424842774e616f38767338555176674978575843396c6e514c4270356f557875515a5648764b344f6c5273376c5556564f46776d63706233614f642b2b784f564735617852702b62366b5166567371336a7351376269356c756948674d70484d5a547850722b7a483336447147366c6c42476a544a7a716c482b7a454477755869576f3135686c69375751617a4e2f447663322b534f37414833524777372f7935544b527466785058706246737567544270762b6e704e7a2b52386a766e435a4f4a394e6f664b41486d7273685944785a66447066416b614b374b662f67434a5a52766f55313061473850424664645363392f53733662702b596a6147784b50676a792b456551784453445168794369796e536f36466a52344d41696b48576945347a396835776e517259554f536e756633614d39464f7239497956347a4a524a6f6f2f7358764d664f7251582b4579636254374c4e2b5558534734544c527361324e76417672746448435a364f39776d7967696a4a6564516d62433978582f6c6153672f58717364626c6572555467654c4b726f55714e794c716b676d6c626374597952366d43784e364b514e724d3151754558434d4a6f6a4e43686d57316944544e5a6a2b57626466526a385359707244584177726e4442642f5470534c62783961724e646f5561696c3139454c3532366f56714e36584e6259594a426b4c747569304945514352304b516b355872483368586679312f2b6d6e4150774e6e34482f346f436769623841414141415355564f524b35435949493d" /></a>
</p>

## Table of Contents
Expand Down Expand Up @@ -52,7 +50,8 @@ https://codesandbox.io/s/xpm699v4lp
[![Edit y3997qply9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/y3997qply9)
[CodeSandbox(with default)](https://codesandbox.io/s/y3997qply9)
[CodeSandbox(with size and position)](https://codesandbox.io/s/my4kjly94x)
[CodeSandbox(with typescript)](https://codesandbox.io/s/j1vvkpo9wv)
[CodeSandbox(with typescript)](https://codesandbox.io/s/j1vvkpo9wv)
[CodeSandbox(with hooks)](https://codesandbox.io/p/sandbox/pensive-babycat-8kxhnr)


## Install
Expand Down Expand Up @@ -310,13 +309,13 @@ The `cancel` property disables specifies a selector to be used to prevent drag i

The direction of allowed movement (dragging) allowed ('x','y','both','none').

#### `bounds?: string;`
#### `bounds?: string; | Element`

Specifies movement boundaries. Accepted values:
- `parent` restricts movement within the node's offsetParent
(nearest node with position relative or absolute)
- `window`, `body`, or
- Selector, like `.fooClassName`.
- `window`, `body`, Selector like `.fooClassName` or
- `Element`.


#### `enableUserSelectHack?: boolean;`
Expand Down Expand Up @@ -511,6 +510,55 @@ If you have a bug to report, please reproduce the bug in [CodeSandbox](https://c

## Changelog

#### v10.5.1

- Upgrade `re-resizable` to `6.11.0`
- Add missing position offset prop

#### v10.4.14

- Upgrade `re-resizable` to `6.10.3`

#### v10.4.13

- Upgrade `re-resizable` to `6.10.0`

#### v10.4.12

- Fixes $945, When using vite and resizing from other than right and bottom - the element is shaking weirdly.

- Upgrade `re-resizable` to `6.9.17`
- Fixes #942, define callback refs inline to work with latest versions of Next.js / React.

#### v10.4.10

- Upgrade `re-resizable` to `6.9.14`

#### v10.4.7

- Fixed a bug, `maxHeight` does not work with `%` #914

#### v10.4.6

- Upgrade `re-resizable` to `6.9.11`
- Upgrade `react-draggable` to `4.4.6`
- Fixed a bug, wrong position in `onDrag` #910

#### v10.4.1

- Support Element for bounds.

#### v10.3.7

- Upgrade `re-resizable` to `6.9.6`
- Add peer deps.


#### v10.3.6

- Upgrade `re-resizable` to `6.9.2`
- Upgrade `react-draggable` to v4.4.4

#### v10.3.5

- Upgrade `re-resizable` to `6.9.1`
Expand Down
11 changes: 9 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
module.exports = {
presets: ["@babel/preset-typescript", "@babel/preset-react"],
plugins: ["@babel/plugin-transform-modules-commonjs", "@babel/plugin-proposal-class-properties"],
presets: [
"@babel/preset-typescript",
'@babel/preset-env',
"@babel/preset-react"
],
plugins: [
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-proposal-class-properties", { "loose": true }]
],
};
18 changes: 18 additions & 0 deletions examples/vite/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions examples/vite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
30 changes: 30 additions & 0 deletions examples/vite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions examples/vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "vite-example",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"typescript": "^5.2.2",
"vite": "^5.3.4"
}
}
Loading