Skip to content

Commit

Permalink
fix: resizable-wrapper cover listen wrong event
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKam committed Nov 7, 2023
1 parent 0fe217a commit f7387ae
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 25 deletions.
7 changes: 7 additions & 0 deletions packages/antd-plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @orca-fe/painter

## 0.3.8

### Patch Changes

- Updated dependencies
- @orca-fe/pocket@3.2.9

## 0.3.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/antd-plus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orca-fe/antd-plus",
"version": "0.3.7",
"version": "0.3.8",
"description": "Transformer Container",
"keywords": [
"react",
Expand Down Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@orca-fe/hooks": "^1.10.0",
"@orca-fe/jss-plugin-auto-prefix": "^0.0.1",
"@orca-fe/pocket": "^3.2.8",
"@orca-fe/pocket": "^3.2.9",
"@orca-fe/simple-jss": "^0.0.3",
"@orca-fe/tools": "^0.10.0",
"ahooks": "^3.7.8",
Expand Down
7 changes: 7 additions & 0 deletions packages/painter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @orca-fe/painter

## 1.4.43

### Patch Changes

- Updated dependencies
- @orca-fe/pocket@3.2.9

## 1.4.42

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/painter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orca-fe/painter",
"version": "1.4.42",
"version": "1.4.43",
"description": "Konva Painter",
"keywords": [
"react",
Expand Down Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@orca-fe/hooks": "^1.10.0",
"@orca-fe/jss-plugin-auto-prefix": "^0.0.1",
"@orca-fe/pocket": "^3.2.8",
"@orca-fe/pocket": "^3.2.9",
"@orca-fe/simple-jss": "^0.0.3",
"@orca-fe/tools": "^0.10.0",
"ahooks": "^3.7.8",
Expand Down
8 changes: 8 additions & 0 deletions packages/pdf-viewer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @orca-fe/pdf-viewer

## 1.19.7

### Patch Changes

- Updated dependencies
- @orca-fe/pocket@3.2.9
- @orca-fe/painter@1.4.43

## 1.19.6

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/pdf-viewer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orca-fe/pdf-viewer",
"version": "1.19.6",
"version": "1.19.7",
"description": "PDF Viewer",
"keywords": [
"react",
Expand Down Expand Up @@ -40,9 +40,9 @@
"dependencies": {
"@orca-fe/hooks": "^1.10.0",
"@orca-fe/jss-plugin-auto-prefix": "^0.0.1",
"@orca-fe/painter": "^1.4.42",
"@orca-fe/painter": "^1.4.43",
"@orca-fe/pdfjs-dist-browserify": "^3.8.24",
"@orca-fe/pocket": "^3.2.8",
"@orca-fe/pocket": "^3.2.9",
"@orca-fe/simple-jss": "^0.0.3",
"@orca-fe/tools": "^0.10.0",
"ahooks": "^3.7.8",
Expand Down
6 changes: 6 additions & 0 deletions packages/pocket/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @orca-fe/pocket

## 3.2.9

### Patch Changes

- fix: resizable-wrapper cover listen wrong event

## 3.2.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pocket/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@orca-fe/pocket",
"version": "3.2.8",
"version": "3.2.9",
"description": "UI components by orca-team",
"keywords": [
"react",
Expand Down
34 changes: 17 additions & 17 deletions packages/pocket/src/resizable-wrapper/ResizableWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,6 @@ const ResizableWrapper = (props: ResizableWrapperProps, pRef) => {

useEventListener('pointerdown', () => {
_this.size = undefined;

// create cover
if (!_this.cover && cover) {
_this.cover = document.createElement('div');
_this.cover.style.position = 'fixed';
_this.cover.style.top = '0';
_this.cover.style.left = '0';
_this.cover.style.right = '0';
_this.cover.style.bottom = '0';
_this.cover.style.zIndex = typeof cover === 'object' && cover.zIndex != null ? cover.zIndex.toString() : '99999';
if (horizontal) {
_this.cover.style.cursor = 'ew-resize';
} else if (vertical) {
_this.cover.style.cursor = 'ns-resize';
}
document.body.appendChild(_this.cover);
}
});

useSizeListener(() => {
Expand Down Expand Up @@ -181,6 +164,23 @@ const ResizableWrapper = (props: ResizableWrapperProps, pRef) => {
initialMouse: e.clientY,
});
}

// create cover
if (!_this.cover && cover) {
_this.cover = document.createElement('div');
_this.cover.style.position = 'fixed';
_this.cover.style.top = '0';
_this.cover.style.left = '0';
_this.cover.style.right = '0';
_this.cover.style.bottom = '0';
_this.cover.style.zIndex = typeof cover === 'object' && cover.zIndex != null ? cover.zIndex.toString() : '99999';
if (horizontal) {
_this.cover.style.cursor = 'ew-resize';
} else if (vertical) {
_this.cover.style.cursor = 'ns-resize';
}
document.body.appendChild(_this.cover);
}
}}
/>
)}
Expand Down

1 comment on commit f7387ae

@vercel
Copy link

@vercel vercel bot commented on f7387ae Nov 7, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.