Skip to content

Commit

Permalink
fix: patch coreui #3042 #2965
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Oct 2, 2024
1 parent c1fcd3a commit 89106a5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/dist/esm/components/modal/CModal.js b/dist/esm/components/modal/CModal.js
index 58f4c61c71168a624a9c0d79318dad9993e3d2aa..315befe3e56de29738642d573253833085d87409 100644
--- a/dist/esm/components/modal/CModal.js
+++ b/dist/esm/components/modal/CModal.js
@@ -30,14 +30,14 @@ var CModal = forwardRef(function (_a, ref) {
var _a;
if (_visible) {
activeElementRef.current = document.activeElement;
- document.addEventListener('mouseup', handleClickOutside);
+ document.addEventListener('mousedown', handleMouseDown);
document.addEventListener('keydown', handleKeyDown);
}
else {
(_a = activeElementRef.current) === null || _a === void 0 ? void 0 : _a.focus();
}
return function () {
- document.removeEventListener('mouseup', handleClickOutside);
+ document.removeEventListener('mousedown', handleMouseDown);
document.removeEventListener('keydown', handleKeyDown);
};
}, [_visible]);
@@ -85,6 +85,9 @@ var CModal = forwardRef(function (_a, ref) {
handleDismiss();
}
};
+ var handleMouseDown = function (event) {
+ document.addEventListener('mouseup', function () { handleClickOutside(event) }, { once: true })
+ }
var handleKeyDown = function (event) {
if (event.key === 'Escape' && keyboard) {
handleDismiss();
2 changes: 1 addition & 1 deletion webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@companion-app/shared": "*",
"@coreui/coreui": "^5.1.2",
"@coreui/react": "^5.3.0",
"@coreui/react": "patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch",
"@fontsource/fira-code": "^5.0.20",
"@fontsource/roboto": "^5.0.15",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
Expand Down
28 changes: 21 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ __metadata:
dependencies:
"@companion-app/shared": "npm:*"
"@coreui/coreui": "npm:^5.1.2"
"@coreui/react": "npm:^5.3.0"
"@coreui/react": "patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch"
"@fontsource/fira-code": "npm:^5.0.20"
"@fontsource/roboto": "npm:^5.0.15"
"@fortawesome/fontawesome-svg-core": "npm:^6.6.0"
Expand Down Expand Up @@ -1590,7 +1590,7 @@ __metadata:
languageName: node
linkType: hard

"@coreui/coreui@npm:^5.1.0, @coreui/coreui@npm:^5.1.2":
"@coreui/coreui@npm:^5.1.2":
version: 5.1.2
resolution: "@coreui/coreui@npm:5.1.2"
peerDependencies:
Expand All @@ -1599,17 +1599,31 @@ __metadata:
languageName: node
linkType: hard

"@coreui/react@npm:^5.3.0":
version: 5.3.0
resolution: "@coreui/react@npm:5.3.0"
"@coreui/react@npm:5.4.0":
version: 5.4.0
resolution: "@coreui/react@npm:5.4.0"
dependencies:
"@coreui/coreui": "npm:^5.1.2"
"@popperjs/core": "npm:^2.11.8"
prop-types: "npm:^15.8.1"
peerDependencies:
react: ">=17"
react-dom: ">=17"
checksum: 10c0/0989cb36e2f400110b255ecbf4bfea5ee9d4ff8435a0271c6b67b023d9285b402f0c3eb7d7095f0005d5436ec83f5ffa1efe0c8524af8509c2e0be77797517b0
languageName: node
linkType: hard

"@coreui/react@patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch":
version: 5.4.0
resolution: "@coreui/react@patch:@coreui/react@npm%3A5.4.0#~/.yarn/patches/@coreui-react-npm-5.4.0-6fcb3b510a.patch::version=5.4.0&hash=56767e"
dependencies:
"@coreui/coreui": "npm:^5.1.0"
"@coreui/coreui": "npm:^5.1.2"
"@popperjs/core": "npm:^2.11.8"
prop-types: "npm:^15.8.1"
peerDependencies:
react: ">=17"
react-dom: ">=17"
checksum: 10c0/6d7904706e4751a1f2e23f97878294415fdcccee996fc119f629c9c629436c89d612dc3b55b17982fc96a5a2126600bde00c4ae5b7b6d2aa50b0c7c9874d0461
checksum: 10c0/d05537106c03eeeb39d1f21a80fa695c82ed12f1235c99475fc8cdbf6f361951d072e5eb80632d39e6c8dab6c8280ce146269b43a2c9d791b41503d5da561dda
languageName: node
linkType: hard

Expand Down

0 comments on commit 89106a5

Please sign in to comment.