Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: Remove react-click-outside in favor of withFocusOutside #99122

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 0 additions & 26 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,32 +1133,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```

## <https://github.com/kentor/react-click-outside>

```
The MIT License (MIT)

Copyright (c) 2015 Kenneth Chung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## <https://github.com/guille/ms.js>

```text
Expand Down
6 changes: 3 additions & 3 deletions client/components/text-control/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FormLabel } from '@automattic/components';
import { withFocusOutside } from '@wordpress/components';
import clsx from 'clsx';
import { Component } from 'react';
import wrapWithClickOutside from 'react-click-outside';

/*
* This component is temporary until we can pull in `@wordpress/components` and merge https://github.com/Automattic/wp-calypso/pull/34277.
Expand All @@ -13,7 +13,7 @@ class MurielTextControl extends Component {
isFocused: false,
};

handleClickOutside() {
handleFocusOutside() {
this.setState( { isFocused: false } );
}

Expand Down Expand Up @@ -87,4 +87,4 @@ class MurielTextControl extends Component {
}
}

export default wrapWithClickOutside( MurielTextControl );
export default withFocusOutside( MurielTextControl );
6 changes: 3 additions & 3 deletions client/my-sites/picker/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withFocusOutside } from '@wordpress/components';
import PropTypes from 'prop-types';
import { Component } from 'react';
import wrapWithClickOutside from 'react-click-outside';
import { connect } from 'react-redux';
import CloseOnEscape from 'calypso/components/close-on-escape';
import SiteSelector from 'calypso/components/site-selector';
Expand Down Expand Up @@ -85,7 +85,7 @@ class SitePicker extends Component {
}
};

handleClickOutside = () => {
handleFocusOutside = () => {
this.closePicker( null );
};

Expand Down Expand Up @@ -127,5 +127,5 @@ function mapStateToProps( state ) {
}

export default connect( mapStateToProps, { setNextLayoutFocus, setLayoutFocus } )(
wrapWithClickOutside( SitePicker )
withFocusOutside( SitePicker )
);
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
"qrcode.react": "^3.1.0",
"qs": "^6.9.1",
"react": "^18.3.1",
"react-click-outside": "^3.0.1",
"react-day-picker": "^7.4.10",
"react-dom": "^18.3.1",
"react-element-to-jsx-string": "^15.0.0",
Expand Down
17 changes: 0 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13245,7 +13245,6 @@ __metadata:
qrcode.react: "npm:^3.1.0"
qs: "npm:^6.9.1"
react: "npm:^18.3.1"
react-click-outside: "npm:^3.0.1"
react-day-picker: "npm:^7.4.10"
react-dom: "npm:^18.3.1"
react-element-to-jsx-string: "npm:^15.0.0"
Expand Down Expand Up @@ -20024,13 +20023,6 @@ __metadata:
languageName: node
linkType: hard

"hoist-non-react-statics@npm:^2.1.1":
version: 2.5.5
resolution: "hoist-non-react-statics@npm:2.5.5"
checksum: 79c204446a61ad490cc9342b2deeedea5a17f03a5fc091f367b6c08f29387c8d5578634ebfb8733043422a5e1182b372893d63f8737ac4b75da3a2ec4a316162
languageName: node
linkType: hard

"hoist-non-react-statics@npm:^3.3.1, hoist-non-react-statics@npm:^3.3.2":
version: 3.3.2
resolution: "hoist-non-react-statics@npm:3.3.2"
Expand Down Expand Up @@ -28209,15 +28201,6 @@ __metadata:
languageName: node
linkType: hard

"react-click-outside@npm:^3.0.1":
version: 3.0.1
resolution: "react-click-outside@npm:3.0.1"
dependencies:
hoist-non-react-statics: "npm:^2.1.1"
checksum: fd7c5c9984bcd1eb6214b5e180aa38dda1dce2cb5286a8ee57b84be2e4821a51eb791c275ebef345c23a010d3f026617c345fbb520bfb3babbc55fdbd08f244d
languageName: node
linkType: hard

"react-codemod@npm:^5.0.5":
version: 5.1.1
resolution: "react-codemod@npm:5.1.1"
Expand Down