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: Stop using `react-click-outside` as a dependency #16878

Merged
merged 1 commit into from Aug 8, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Components: Stop using `react-click-outside` as a depenency

  • Loading branch information...
gziolo committed Aug 2, 2019
commit f1771eac671c2dcd6ef2d388833ca594c5185049

Some generated files are not rendered by default. Learn more.

@@ -17,6 +17,7 @@

- The `Dropdown` component has been refactored to focus changes using the `Popover` component's `onFocusOutside` prop.
- The `MenuItem` component will now always use an `IconButton`. This prevents a focus loss when clicking a menu item.
- Package no longer depends on external `react-click-outside` library.

## 8.0.0 (2019-06-12)

@@ -42,7 +42,6 @@
"moment": "^2.22.1",
"mousetrap": "^1.6.2",
"re-resizable": "^5.0.1",
"react-click-outside": "^3.0.0",
"react-dates": "^17.1.1",
"react-spring": "^8.0.20",
"rememo": "^3.0.0",
@@ -6,14 +6,10 @@ import { ESCAPE } from '@wordpress/keycodes';
import { focus } from '@wordpress/dom';
import { withGlobalEvents, compose } from '@wordpress/compose';

/**
* External dependencies
*/
import clickOutside from 'react-click-outside';

/**
* Internal dependencies
*/
import withFocusOutside from '../higher-order/with-focus-outside';
import withFocusReturn from '../higher-order/with-focus-return';
import withConstrainedTabbing from '../higher-order/with-constrained-tabbing';

@@ -23,7 +19,7 @@ class ModalFrame extends Component {

this.containerRef = createRef();
this.handleKeyDown = this.handleKeyDown.bind( this );
this.handleClickOutside = this.handleClickOutside.bind( this );
this.handleFocusOutside = this.handleFocusOutside.bind( this );
this.focusFirstTabbable = this.focusFirstTabbable.bind( this );
}

@@ -52,7 +48,7 @@ class ModalFrame extends Component {
*
* @param {Object} event Mouse click event.
*/
handleClickOutside( event ) {
handleFocusOutside( event ) {
if ( this.props.shouldCloseOnClickOutside ) {
this.onRequestClose( event );
}
@@ -133,7 +129,7 @@ class ModalFrame extends Component {
export default compose( [
withFocusReturn,
withConstrainedTabbing,
clickOutside,
withFocusOutside,
withGlobalEvents( {
keydown: 'handleKeyDown',
} ),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.